[Tutor] Raw string

Neven Goršić neven.gorsic at gmail.com
Sun Apr 18 23:49:31 CEST 2010


Hi!

When I get file path from DirDialog, I get in a (path) variable.
Sometimes that string (path) contains special escape sequences, such as \x,
\r and so on.

             'C:\Python25\Programs\rating'

When I try to open that file (whose name contains escape sequences) it
doesn't work.

I know that raw string marker 'r' in front of string leaves char '\' as
character and not as start of escape sequences,
but I can not apply it to a variable name which contains file path.

Is there a function with same effect as raw string marker, as my problem
must be solved differently?

Can you help me?

Kind regards,

Neven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100418/1f7c6851/attachment.html>


More information about the Tutor mailing list