Help with Python

Fernando Armenta farmenta at pillardata.com
Tue Sep 16 17:16:56 EDT 2003


Hello!

 

I am new to Python and I would like to write the following code:

 

I need to check for a directory and move it to other directory if is
found.  The directory always starts with outlog.XYZ and ends in XYZ
(where XYZ are variables).  I need to use wild characters.  Here is what
I have, but is not working.  Any help would be appreciated.  

 

#Path for the file

home_trace = "/home/testeng/ca/tds/outlog.* "

 

#Path for the directory where I want to move the file

directory = "/home/testeng/ca/tds/unattached"

 

#If statement 

if os.path.exists(home_trace):

        os.system ("chmod -fR 775 outlog.* ")

        os.system ("mv outlog.* " + directory)

 

Fernando Armenta

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030916/6eec055b/attachment.html>


More information about the Python-list mailing list