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 except that exec is a function.

with open('otherfile.py') as f:
  exex(f)


For more, read the doc:
http://docs.python.org/2.7/reference/simple_stmts.html#the-exec-statement
HTH




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to