filename variables

Diez B. Roggisch deets at nospam.web.de
Thu Mar 2 09:52:45 EST 2006


cyborg4 at walla.co.il wrote:

> If in  Windows XP I use:
> 
> openstring= "test.py  >foo.txt"
> os.system(openstring)
> 
> it works.
> 
> 
> But if I use:
> 
> file1='foo.txt'
> openstring= "test.py  >"+file1
> 
> It gives an IOError about no such file or directory as
> \\mydidr\\foo.txt
> 
> What does it mean ?

That you obviously didn't give us the actual (non-) working code, but
something you believe is essential. Because

file1='foo.txt'
openstring= "test.py  >"+file1

certainly doesn't give that error.

Post a running, self contained examplpe, and we might be able to help you.

Diez




More information about the Python-list mailing list