Calling function from command line

Henrik Motakef henrik.motakef at
Wed Sep 18 17:27:41 EDT 2002

gregoryk at (GREGORY KNESER) writes:

> c:\python22\python func1('input1','input2')
> or some such thing and run the function with the inputs I fed it rather 
> than the defaults.  Is such a call possible?

Not quite, but maybe something like

  python -c "import func; func.func1('input1','input2')"

works for you. Or perhaps

  echo 'func1("input1", "input2")' | python -i


More information about the Python-list mailing list