On 8/7/07, Will Maier <[EMAIL PROTECTED]> wrote: > > On Tue, Aug 07, 2007 at 05:45:46PM -0400, brad wrote: > > What's the proper way to call a py script and pass in variables > > while doing cron jobs? I can run the scripts fine from idle, > > python, etc using raw_input() to prompt users. The scripts have > > classes with methods that need arguments. > > This is commonly done with either sys.argv (a list of arguments > passed when invoking the script) or os.environ (a dictionary of > environment variables and values). Use either to instantiate your > classes or run functions.
You might also want to look at the function getopt < http://docs.python.org/lib/module-getopt.html>. It's used to parse the variables in sys.argv which makes it (in my opinion) more user friendly. -- <:3 )~
-- http://mail.python.org/mailman/listinfo/python-list