> Hey- suppose we have a file name-"my file number"
> if we want to execute it into the terminal it would be like - my\ file\ number
>
> so wondering is there any one in the python that change the enter string into
> the terminal string one-
> like if user enter the file name with path- "my file number". i want to
> automatically convert it into "my\ file\ number"
> Plz help me out in this.
>>> a = "my file number"
>>> a.replace(' ', '\\ ')
'my\\ file\\ number'
>>> print a.replace(' ', '\\ ')
my\ file\ number
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor