[Tutor] How to programmatically EDIT a python file using an editorof my choice ?

Dominique mydomdom at gmail.com
Mon Apr 13 08:26:27 CEST 2009


Sander Sweers <sander.sweers <at> gmail.com> writes:

Hello Sander,

> 
> The r means the string is a raw string.
> 
> The real issue is what Alan pointed out. The backlash is an escape
> character and if you want to use it in a string should be escaped by a
> backlash.Using a raw string will give the same result as 'C:\\Program
> Files\\Editra\\Editra.exe'
> 
> Greets
> Sander

OK. I understand.

What surprises me is that before calling the subprocess.Popen() method, I
normalized the path using:
filename = os.path.normpath(filename).

Consequently, I thought the path was corrected from the backslash problems.

Anyway, Thank you very much for your help.

Dominique





More information about the Tutor mailing list