Vous n’êtes pas connecté.
Bonjour, visiteur, bienvenue sur les forums Aqua Computer Forum. Si c’est votre première visite, nous vous invitons à consulter l’Aide. Elle vous expliquera le fonctionnement de cette page. Pour avoir accès à toutes les fonctionnalités, vous devez vous inscrire. Pour cela, veuillez utiliser le formulaire d’enregistrement, ou bien lisez plus d’informations sur la procédure d’enregistrement. Si vous êtes déjà enregistré, veuillez vous connecter.
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 |
import wx class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello from wxPython") frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop() |
![]() |
Code source |
1 2 |
if __name__ == '__main__': doSomething() |
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 |
import wx if __name__ == '__main__': class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello from wxPython") frame.Show(True) self.SetTopWindow(frame) return True app = MyApp(0) app.MainLoop() |
Citation
C:\>python wxtest.py
Traceback (most recent call last):
File "wxtest.py", line 4, in ?
class MyApp(wxApp):
NameError: name 'wxApp' is not defined
![]() |
Code source |
1 |
from wx import * |
![]() |
Code source |
1 |
from wx import wxApp, wxFrame |
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 |
from wx import wxApp, wxFrame class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello from wxPython") frame.Show(True) self.SetTopWindow(frame) return True if __name__ == '__main__': app = MyApp(0) app.MainLoop() |
Citation
C:\>python wxtest.py
Traceback (most recent call last):
File "wxtest.py", line 1, in ?
from wx import wxApp, wxFrame
ImportError: cannot import name wxApp
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 |
from wxPython.wx import * class mainapp(wxApp): def OnInit(self): frame = mainwindow(NULL, -1, "blablubb") frame.Show(true) self.SetTopWindow(frame) return true app = mainapp(0) app.MainLoop() |
Citation
C:\>python wxtest.py
Traceback (most recent call last):
File "wxtest.py", line 1, in ?
from wxPython.wx import *
File "C:\Python\Python24\Lib\site-packages\wx-2.5.3-msw-unicode\wxPython\__init__.py", line 10, in ?
import _wx
File "C:\Python\Python24\Lib\site-packages\wx-2.5.3-msw-unicode\wxPython\_wx.py", line 3, in ?
from _core import *
File "C:\Python\Python24\Lib\site-packages\wx-2.5.3-msw-unicode\wxPython\_core.py", line 15, in ?
import wx._core
ImportError: No module named _core
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 |
import wx class mainapp(wx.App): def OnInit(self): frame = wx.Frame(NULL, -1, "blablubb") frame.Show(true) self.SetTopWindow(frame) return true app = mainapp(0) app.MainLoop() |
-