verify that '/tmp' is a valid directory and change to that temporary directory, call the getcwd() method : Directory : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Directory »

 

verify that '/tmp' is a valid directory and change to that temporary directory, call the getcwd() method


import os


print os.path.isdir('/tmp')
os.chdir('/tmp')
cwd = os.getcwd()
print cwd



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Directory