Hi,
I have to start a GUI from an existing Python application. The GUI is actually separate Python GUI that can run alone. Right now, I am starting the GUI using something like:
res=Popen(['c:\python26\pythonw.exe',
full_filename,
str(RESULTs),
str(context)], stdout=PIPE).communicate()[0]
where full_filename is the full path to the python GUI. As you can see, the problem is that I have to communicate the RESULTS variable to the GUI via the commandline. This works fine until the commandline get too long and I have to pickle the variables to a separate file and then re-load them when the GUI starts. This works but it is slow.
Thus, what I want to do is somehow start the GUI from within my python script, transfer the variables in question to the GUI for it to process, and then capture the GUI's results back in the calling script. As you can see above, this currently happens through the res
variable since the GUI can be configured to write its output to the standard output which is captured in this variable.
Any ideas? I'm hoping someone can suggest a more elegant way of doing this. This all happens on a winXP machine.