[Tutor] Running program from Python

Chris Smith mc_anjo at tamu.edu
Fri Jul 20 23:30:21 CEST 2007


Howdy,

I am working on some research. I'm trying to optimize the performance of 
an antenna. For the simulation of the antenna it would be easiest to use 
an antenna software package that I have in my lab. I know that Matlab 
can call the antenna software through a command called system. Matlab 
also uses system to pass a VB script file to the antenna software that 
tells the software what to do. However, I don't have access to Matlab in 
my lab.

I use Python for a lot of program prototyping, and was looking through a 
Python reference book to see if there was something in there I could 
use. I ran across two functions that I thought might work. They are in 
the os module and are the different exec functions and also the spawnv 
function.

The python program would run something like this:
1) optimization program comes up with initial variables to try
2) a VB script is generated
3) antenna program called and given the VB script
4) antenna program evaluates the antenna
5) results are sent back to optimization program
6) optimization program evaluates results and generates new variables
7) process from 2 on is repeated

Would either of these two functions be what I need?

Thanks for your help.

Chris S.



More information about the Tutor mailing list