[python-win32] calling python as process from vb.net
Pam Westphal
pwestphal at mcn.net
Wed Jul 29 19:14:34 CEST 2009
I have a great python script that does quite a bit of statistical smoothing after reading data from a SQL table and then writes the results to a table. I don't really want to convert it into C. Currently I call the python script as a process from vb.net. About 1/2 of the time Python stops running with a
"pythonw.exe - Application error" "The instruction at 'xxx' referenced memory at 'xxx'. The memory could nto be 'read'"
error. When I run the same python script from the command line it is fine. If I run it from vb.net in debug mode and step through, it is fine too.
Should I make the python script into an executable? Should I make the Python script into a com (I tried this but vb.net wouldn't accept it as a valid com).
**** starting the process ***********
dim p as new process
p.StartInfo.FileName = "pythonw.exe"
p.StartInfo.WorkingDirectory = "C:\Python25\work\"
p.StartInfo.Arguments = "smooth_data_kiosk2.py " & datafields.Trim
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.UseShellExecute = False
p.StartInfo.CreateNoWindow = True
p.Start()
Thank you for any ideas/help.
Pam
More information about the python-win32
mailing list