Important things to know in python:
import sys print sys.argv # this is an array containing all command line arguments inclusive the program name
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
help="write report to FILE", metavar="FILE")
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't print status messages to stdout")
(options, args) = parser.parse_args()
Code example:
#!/usr/bin/env python # this finds the default python executable defined by the current environment (PATH). print "test"
In the console don't forget to give executable permissions:
chmod +x example.py
os.walk("dir")
os.*
sys.argv
optparse multiprocessing numpy