Du bist nicht angemeldet.
Lieber Besucher, herzlich willkommen bei: Aqua Computer Forum. Falls dies dein erster Besuch auf dieser Seite ist, lese dir bitte die Hilfe durch. Dort wird dir die Bedienung dieser Seite näher erläutert. Darüber hinaus solltest du dich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutze das Registrierungsformular, um dich zu registrieren oder informiere dich ausführlich über den Registrierungsvorgang. Falls du dich bereits zu einem früheren Zeitpunkt registriert hast, kannst du dich hier anmelden.

|
|
Quellcode |
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()
|
|
|
Quellcode |
1 2 |
if __name__ == '__main__':
doSomething()
|

*vonC++gewöhntist*|
|
Quellcode |
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()
|
Zitat
C:\>python wxtest.py
Traceback (most recent call last):
File "wxtest.py", line 4, in ?
class MyApp(wxApp):
NameError: name 'wxApp' is not defined

|
|
Quellcode |
1 |
from wx import * |
|
|
Quellcode |
1 |
from wx import wxApp, wxFrame |
|
|
Quellcode |
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()
|
Zitat
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


|
|
Quellcode |
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()
|
Zitat
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

... Obwohl ich dann gleich mit C++ weitermachen könnte *hrhr*|
|
Quellcode |
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()
|

-