Re: how to run another file inside current file?

2013-05-18 Thread fjct...@gmail.com
subprocess? 发自我的小米手机 Avnesh Shakya avnesh.n...@gmail.com编写: hi, I want to run a another file inside a ached.add_cron_job(..). how is it possible, please help me, I have a file otherFile.py for execution inside current file. I know it is very easy question but i m unable to get

Re: how to run another file inside current file?

2013-05-18 Thread Kevin Xi
Hi, It's better to specify version of python you work with. I know nothing about python 3 but in python 2 you can do this with `exec`. Example: f = file('otherFile.py') exec f For more, read the doc: http://docs.python.org/2.7/reference/simple_stmts.html#the-exec-statement HTH

Re: how to run another file inside current file?

2013-05-18 Thread Terry Jan Reedy
On 5/18/2013 7:15 AM, Kevin Xi wrote: Hi, It's better to specify version of python you work with. Absolutely. I know nothing about python 3 but in python 2 you can do this with `exec`. Example: f = file('otherFile.py') exec f Py 2 has execfile that does the above. Py 3 do as above

how to run another file inside current file?

2013-05-17 Thread Avnesh Shakya
hi, I want to run a another file inside a ached.add_cron_job(..). how is it possible, please help me, I have a file otherFile.py for execution inside current file. I know it is very easy question but i m unable to get anything, please help me. example -- import otherFile from