Here's an example on what I'm thinking:
def check_args():
if len(sys.argv) < 2:
sys.exit('Reason')
if not os.path.exists(sys.argv[1]):
sys.exit('ERROR: Folder %s was not found!' % sys.argv[1])
global path
path = sys.argv[1]
As you can tell after check_args() completes succefully the "path" variable has universal meaning - you can use it in other functions as de-facto variable.
So I'm thinking if there is a way to access "path" e.g. check_args.path?
How about in python v3?