jtl999 wrote:
I want to pass a variable to os.system which is dir
dir=raw_input ("Dir Please ")
Dir Please /
ok dir = /
os.system ("ls"  + dir)
sh: ls/: No such file or directory
32512

any advice

Yes -- learn to read the error messages you get. The error you get is a shell error, not a Python error. It is *exactly* the same error you would get if you do this by hand:

sh-3.2$ ls/
sh: ls/: No such file or directory

This tells you that the shell can't find a file called "ls/". No surprises there -- you want "ls /". So you need to include a space in the shell command that you pass to os.system.


--
Steven

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to