|
Hi All, I have created the following dialog with xwPython called from a syntax editor window of PASW Statistics 17: BEGIN PROGRAM PYTHON . import wx app = wx.PySimpleApp()
dialog.Destroy()
END PROGRAM . When I start a new session of SPSS 17 the dialog is properly displayed. But calling it the second time nothing happens when running from inside SPSS 17. If I do the same using a Python IDE like WingIDE the dialog is presented even it I run the routine twice. What do I have to change to get the dialog even if I run it multiple times in SPSS? I have to add that we need to run it in SPSSdX mode instead of SPSSxD mode. Best regards G.Maubach |
|
I think the problem comes from creating and destroying the app
object multiple times in the same session. Back when the Python code ran
in the same process as SPSS, it was unwise to leave the wxPython app around,
because it fought with the regular SPSS gui. With recent versions, where
Python is running in a separate process, this shouldn’t be an issue
anymore. So, if you change the code below so that it doesn’t
destroy the app at the end of the program and reuses the app object if it
already exists, you should be okay. Remember that the Python variables
stay around across multiple programs run in the same session. Ideally, you should shut down the app when the SPSS program
terminates, but you can probably get away without that step. HTH, Jon Peck From: SPSSX(r) Discussion
[mailto:[hidden email]] On Behalf Of Georg Maubach Hi All,
I have
created the following dialog with xwPython called from a syntax editor window
of PASW Statistics 17: BEGIN PROGRAM
PYTHON . import wx app =
wx.PySimpleApp() dialog.Destroy()
END PROGRAM .
When I start
a new session of SPSS 17 the dialog is properly displayed. But calling it the
second time nothing happens when running from inside SPSS 17. If I do the same
using a Python IDE like WingIDE the dialog is presented even it I run the
routine twice. What do I
have to change to get the dialog even if I run it multiple times in SPSS?
I have to
add that we need to run it in SPSSdX mode instead of SPSSxD mode. Best regards
G.Maubach |
| Free forum by Nabble | Edit this page |
