how to proccess the blank in the path on linux

zhf mypromise at sina.com
Wed May 21 10:26:49 EDT 2008


I want ro walk a directory and its sub directory on linux,
to find some shell script file, and run them, but I found some path belong
blank charactor, such as '8000 dir', if I write as follow, I got error
"no such file"
path = '8000 dir'
for root, dirs, files in os.walk(path):
cmd = ' '
cmd = 'cd ' + root
os.system(cmd)

How can I repair it?

thanks, best regards.






More information about the Python-list mailing list