reading in a string

ghost_man at my-deja.com ghost_man at my-deja.com
Tue May 16 22:58:09 EDT 2000


I am writing a python script that through the
os.system command calls VSS and imports the files
over. I then run
os.system('dir /s >> myfile.txt')

I want to be able to read in the contents of the
file one line at a time and execute some command
on it.  My problem is when the file is something
like C:\program files\python\temporary   Python
reads it as c:\program files\python\011emporary

I am getting tripped up by the \t switch.  I
cannot at this point and time run string.replace
because it has already been converted over.  Any
ideas how I can read the string in correctly?  I
have explored the glob module and it would seem
very cumbersome to try and cover this.  Is there
an easier way to read in the contents of my file
and have them import correctly?


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list