NEWBIE TIP: Reading a file two different ways...from ENGSOL

Markus Schaber markus at schabi.de
Tue Aug 7 12:46:27 EDT 2001


Hi,

Peter Mayne <Peter.Mayne at au1.ibm.com> schrub:
[...]
>> readfile("c:\\python21\\tags\\cauxd.tex")
> 
> Windows is perfectly happy to accept "/" as a legal path separator, so
[...] 
> readfile("c:/python21/tags/cauxd.tex")
> 
> is more readable, and saves a comment 8-).

There's another way: raw strings

readfile(r"c:\python21\tags\cauxd.tex")

markus
-- 
Defend democrathy and freedom!



More information about the Python-list mailing list