You are not logged in.
Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

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

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

|
|
Source code |
1 |
from wx import * |
|
|
Source code |
1 |
from wx import wxApp, wxFrame |
|
|
Source code |
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()
|
Quoted
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


|
|
Source code |
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()
|
Quoted
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*|
|
Source code |
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()
|

-