Python Data Visualization Cookbook by Unknown

Python Data Visualization Cookbook by Unknown

Author:Unknown
Language: eng
Format: epub
Publisher: Packt Publishing


Next, we will implement the main program body where we verify the input arguments given by the user when the program is called from the command line:if __name__ == '__main__': if len(sys.argv) is not 2: print "ERROR: Please supply path to folder." sys.exit(-1) start_path = sys.argv[1] if not os.path.exists(start_path): print "ERROR: Path must exits." sys.exit(-1) folders = build_folders(start_path) if len(folders) < 1: print "ERROR: Path does not contain any folders." sys.exit(-1) draw(folders)

You need to run the following from the command line:

$ python ch04_rec11_filesystem.py /usr/lib/



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.