All the answers were related to different versions of PythonBut I generally write the code on the version that is minimal.
from os.path import existsfrom sys import argvscript,form_file = argvfile = open(from_file) if exists(from_file): print "File path is invalid." else: print "File does not exist."