import sys import os from ldtputils import * full_path = os.environ['HOME'] + '/firefox' if os.path.isdir(full_path): print "Directory exists" full_path = full_path + '/firefox' if os.path.isfile(full_path): print "File exists" full_path = full_path + ' -P spooky' print full_path launchapp(full_path,1) else: print "Oops! no file" sys.exit(0) else: print "Directory doesn't exist" sys.exit(0)