import sys filename = sys.argv[1] args = dict([arg.split('=', maxsplit=1) for arg in sys.argv[2:]]) print filename print args