L
loial
How can I delete hidden files on unix with python, i.e I want to do
equivalent of
rm .lock*
equivalent of
rm .lock*
.... os.remove(fn)loial said:How can I delete hidden files on unix with python, i.e I want to do
equivalent of
rm .lock*
loial said:How can I delete hidden files on unix with python, i.e I want to do
equivalent of
rm .lock*
Here is one way to do it:
import os, glob
for filename in glob.glob('.lock*'):
os.unlink(filename)
Alternatively, you could also do this:
import os
os.system('rm .lock*')
cu
Philipp
Another way is to execute the linux command directly
Check here:http://love-python.blogspot.com/2008/02/execute-linux-commands-in-pyt...
loial said:How can I delete hidden files on unix with python, i.e I want to do
equivalent of
rm .lock*
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.