#!/usr/bin/python3 import sys, os filename = sys.argv[1] if os.path.exists(filename): print('file exists') print('path to file:', os.path.dirname(os.path.abspath(filename))) print('name of file:', os.path.basename(os.path.abspath(filename))) else: print('file does not exist')