<br><br><div><span class="gmail_quote">On 8/7/07, <b class="gmail_sendername">Will Maier</b> <<a href="mailto:willmaier@ml1.net">willmaier@ml1.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Aug 07, 2007 at 05:45:46PM -0400, brad wrote:<br>> What's the proper way to call a py script and pass in variables<br>> while doing cron jobs? I can run the scripts fine from idle,<br>> python, etc using raw_input() to prompt users. The scripts have
<br>> classes with methods that need arguments.<br><br>This is commonly done with either sys.argv (a list of arguments<br>passed when invoking the script) or os.environ (a dictionary of<br>environment variables and values). Use either to instantiate your
<br>classes or run functions.</blockquote><div><br><br>You might also want to look at the function getopt <<a href="http://docs.python.org/lib/module-getopt.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://docs.python.org/lib/module-getopt.html</a>>. <br>
It's used to parse the variables in sys.argv which makes it (in my opinion)<br>more user friendly. <br></div></div><br>-- <br><:3 )~