Is it possible to make a Python program which checks if a file exists, maybe like:
#!/usr/bin/python
if exist 'File.txt':
print "File.txt exists!"
else:
print "File.txt does not exist :-("
Obviously the if exist
code will fail, as it is not a python command, but is there anything like the above which works?