ABSTRACT

Writing command-line Python scripts makes it possible to run programs from the Unix shell, which facilitates both scalability and interoperability with data analysis pipelines. The Python module can be used to parse user input, and provides other expected command line functionality such as positional and optional arguments, and help messages. Python scripts can take input from files or directly from standard input and write to fies or the standard output. When writing Python scripts statements are put first first, and use a special variable called to check whether the script is run as the main program or called from another program. Instead of having one long script for all code, it is recommended to modularize code into different files according to functionality and to document the behavior of each module and function carefully in their respective docstring.