July 2015
Intermediate to advanced
366 pages
8h 7m
English
Instead of hardcoding your scripts with paths to specific datasets, you can make your scripts more flexible by allowing them to accept input in the form of parameters from the command prompt. These input parameters can be captured using Python's sys.argv[] object.
Python's sys.argv[] object allows you to capture input parameters from the command line when a script is executed. We will use an example to illustrate how this works. Take a look at the following screenshot:

Each word must be separated by a space. These words are stored in a zero-based list object called sys.argv[]. In the sys.argv[] ...
Read now
Unlock full access