Jul-04-2018, 03:39 AM
Hi i am currently trying to put 2 directories that i am going to use in 2 different functions.
These are the location:
/disks/user/mmaz/mmaz05/rundir
/disks/user/mmaz/mmaz05/in_file
The script is currently in /disks/user/mmaz/mmaz05/rundir. I am having problem with the second function on how do i go one level up to /in_file directory?
These are the location:
/disks/user/mmaz/mmaz05/rundir
/disks/user/mmaz/mmaz05/in_file
The script is currently in /disks/user/mmaz/mmaz05/rundir. I am having problem with the second function on how do i go one level up to /in_file directory?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/usr/bin/python import os import os.path myPWD = os.getcwd() def run_directory( str ): print str return def infile_directory ( str ): #need to go one step up to infile directory print str return run_dir = run_directory(myPWD) infile_dir = infile_directory(myPWD) |