How can I execute a large number of scripts with IronPython and avoid the startup cost of ipy.exe? By large I mean over 100. Each script is a simple acceptance test for a service application and will run very quickly.
The simplest approach I can think of is a cmd file that loops through the *.py files calling:
ipy <filename1>.py
ipy <filename2>.py
...
However each script would then incur the overhead of starting ipy.exe. Some research on http://python.org turned up the exec function开发者_JAVA百科. A master python script that loops through each of the test script files and calls exec with the file contents looks like a viable alternative - is this a reasonable approach?
Edit: this was far simpler than I realized - see 2 lines below. Python is awesome!
for filename in list_of_files:
    exec(open(filename).read())
Try execfile.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论