[Tutor] Arrgh! Paths on windows!
Guillermo Fernandez Castellanos
guillermo.fernandez at epfl.ch
Tue Feb 24 11:12:29 EST 2004
Try either:
tmp = os.path.normpath("c:/Documents and Settings/Joe Blow/Local \
Settings/Temporary Internet Files")
or put everything in one single line.
The problem is that you split your string in 2 parts, and the interpreter tells
you that he find the start of the string but not the end.
your command is equivalend to type:
>>> tmp = os.path.normpath("c:/Documents and Settings/Joe Blow/Local
SyntaxError: EOL while scanning single-quoted string
>>>
in IDLE :-)
Guille
vmonkey wrote:
> What is wrong with the following lines of code?
>
> import os
>
> tmp = os.path.normpath("c:/Documents and Settings/Joe Blow/Local
> Settings/Temporary Internet Files")
>
> It SHOULD create a path properly formatted for windows in the variable
> tmp. But I get this error whenever I run it:
>
> SyntaxError: EOL while scanning single-quoted string
>
> Can anyone help me with this?
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list