Variable passing to external program - How??

Rigga Rigga at noemail.com
Sat Oct 11 07:17:29 EDT 2003


Hi,

Ok first please bear with me as I am a total Python n00b..

Can anyone explain why this does not like me using % FileLoc in the
os.system call???

#!/usr/bin/python
import sys
import os
# Check that the folder is accessible and writeable
FileLoc = os.path.exists('/home/rigga')
if (FileLoc):
        print "File location exists:"
        AccFlag = os.access('% FileLoc',os.R_OK | os.X_OK | os.W_OK)
        if (AccFlag):
                print "You have FULL access to the location"
        else:
                print "**Error - You do not have access to the location**"
else:
        print "No files found exiting..."

sys.exit()

I have full access to the folder I am checking however it always returns no
files found (FileLoc = 0) however if I specify the folder I want to test in
the os.system call it works fine...

Any help appreciated

Cheerz

Rigga





More information about the Python-list mailing list