April 2015
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  

Categories

April 2015
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  

Python file and DIRECTORY

import os import os.path PATH=’./file.txt’ if os.path.isfile(PATH) and os.access(PATH, os.R_OK): print “File exists and is readable” else: print “Either file is missing or is not readable” import os fname = “foo.txt” if os.path.isfile(fname): print “file does exist at this time” else: print “no such file” Try opening the file:Opening the file will always verify the […]