filename variables

C

cyborg4

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 ?
 
D

Diez B. Roggisch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,285
Messages
2,571,416
Members
48,108
Latest member
Virus9283

Latest Threads

Top