os.system questions

Eric Price soyouthinkimgonnalikethis at hotmail.com
Sat Mar 31 17:10:17 CEST 2007

Thank you :)

>From: "Parthan SR" <python.technofreak at gmail.com>
>To: "Eric Price" <soyouthinkimgonnalikethis at hotmail.com>
>Subject: Re: os.system questions
>Date: Sat, 31 Mar 2007 19:52:01 +0530
>On 3/31/07, Eric Price <soyouthinkimgonnalikethis at hotmail.com> wrote:
>>Oops! The problem isn't in the os.system call. It's in the fact that I
>>call the function. That is, I write a script called "test.py" with a
>>function in it called "freshReboot". Now, how do I call that function from
>>test.py? That is, how do I write a cron event such that "freshReboot"
>>actually gets called when I run test.py?
>Just call the function name within the test.py itself
>def freshReboot():
>if __name__ == '__main__':
>    freshReboot()
>Now, run test.py. If you are printing anything or having a return value,
>then it will be displayed in the terminal from where you call the program.
>If you are executing it from another script, then the return value will be
>returned where it is being called.
>With Regards
>Research Assistant
>National Resource Center for Free/Open Source Software
>Python Developer n00b

Interest Rates near 39yr lows! $430,000 Mortgage for $1,399/mo - Calculate 
new payment 

More information about the Python-list mailing list