From: Frank C. <fc...@pu...> - 2001-09-21 20:39:50
|
If anyone will confirm this is the best way to use exec and globals, I would certain appreciate your feedback. The goal is to have the Jython equivalent of server-side include files where one script calls another and can share variables. In an experiment I created two files: exec_example.py def makethecall: i=100 exec open("included.py").read() print "j=", j makethecall() included.py j=101 print "i=", i By running exec_example I see: i=100 j=101 Is this the best way to have scripts calling other scripts and returning results? -Frank -- Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for Load, a free open-source tool for performance and scalability testing and data migration. |