wxPython looses function "wxPython.wx.miscc"

A

Anand

I am calling a python script from LabVIEW. This is achieved by making
a dll call to python22.dll. It works perfectly well for most of my
code. I now want to throwup dialog boxes from python. It works just
fine if i run the code once.

but when i call the same piece of code the second time,
wxPython.wx.miscc does not exist for some reason. I dont know how this
gets deleted. I guess this happens during some kind of clean up. The
code that i use for showing a dialog box is as follows:

from wxPython.wx import *
app = wxPySimpleApp()
dlg = wxMessageDialog(None, Text,
'A Message Box', wxOK | wxICON_INFORMATION)
#wxYES_NO | wxNO_DEFAULT | wxCANCEL |
wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
app.MainLoop()

when i call it the second time i get the following error:

line 1139, in showDialog
from wxPython.wx import *
File "C:\PROGRA~1\Python22\lib\site-packages\wxPython\wx.py", line
4, in ?
from misc import *
File "C:\PROGRA~1\Python22\Lib\site-packages\wxPython\misc.py", line
2, in ?
import miscc
ImportError: No module named miscc

is there a solution? What is really happening? i am new to
WxPython.
 
C

Cliff Wells

I am calling a python script from LabVIEW. This is achieved by making
a dll call to python22.dll. It works perfectly well for most of my
code. I now want to throwup dialog boxes from python. It works just
fine if i run the code once.

but when i call the same piece of code the second time,
wxPython.wx.miscc does not exist for some reason. I dont know how this
gets deleted. I guess this happens during some kind of clean up. The
code that i use for showing a dialog box is as follows:

from wxPython.wx import *
app = wxPySimpleApp()
dlg = wxMessageDialog(None, Text,
'A Message Box', wxOK | wxICON_INFORMATION)
#wxYES_NO | wxNO_DEFAULT | wxCANCEL |
wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
app.MainLoop()

when i call it the second time i get the following error:

line 1139, in showDialog
from wxPython.wx import *
File "C:\PROGRA~1\Python22\lib\site-packages\wxPython\wx.py", line
4, in ?
from misc import *
File "C:\PROGRA~1\Python22\Lib\site-packages\wxPython\misc.py", line
2, in ?
import miscc
ImportError: No module named miscc

Is your wxApp.MainLoop() exiting? I think there is some cleanup code
that happens immediately after that.

You should post your question to the wxPython list:

http://www.wxpython.org/maillist.php

Cliff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top