Skip to main content

A tool to run a python function in a module from command line

Project description

Run a python function in a module from command line and shift sys.argv, so function can parse sys.argv properly. Downloads


$ pip install pyfuncrun


$ pyfuncrun <> <func arguments> <arguments for func to parse in sys.argv>


import sys

def print_sys_argv():
    print sys.argv

def func_with_args(a, b):
    print ((a + b), sys.argv)

def func_with_kwargs(a, b, c=1):
    print ((a + b + c), sys.argv)


$ pyfuncrun func.print_sys_argv 1 2
['pyfuncrun', 1, 2]

$ pyfuncrun func.func_with_args 1 2
(3, ['pyfuncrun'])

$ pyfuncrun func.func_with_kwargs 1 2 3 4
(6, ['pyfuncrun', 4])

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyfuncrun, version 0.1.8
Filename, size File type Python version Upload date Hashes
Filename, size pyfuncrun-0.1.8.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page