Subprocess Problem (Wait and while)
python.koda at gmail.com
Mon Aug 9 18:08:00 CEST 2010
I have some problem with my actual code.
In fact, the script is done to work within nuke from the foundry which is a
Homever, I have some code difficulties as I quite new in the area.
Here the deal:
Im using subprocess command to copy some files into local directory, like
cmd = ['xcopy', '/E', '/I', '/Q', '/Y', '%s' % _folder.replace('/',
'\\'), '%s' % _temp.replace('/', '\\')]
Its copying quite well. I have no problem with that. But, after the copy I
would like to continue my code, but ONLY if the copy is done.
If Im using a WAIT, its freezing the main program (nuke) until the copy in
done. I want to avoid that. I also try "call" but same thing. Its
I though about something like:
while subprocess not finished:
Like this its checking if the files is copying and do nothing until its
done. I also tough:
while os.listdir(src) != os.listdir(dst):
But Im not sure its quite good solution.
Someone can help me with this one please ?
Thank you ! :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list