Seite 1 von 1

wx PySimpleApp Problem

Verfasst: Sonntag 15. Juli 2007, 21:33
von MrBigBrain
Juhu, das ist mein erster Post in diesem Forum. :D
Seit gestern lerne ich Python und wollte jetzt mal ein Fenster mit wx erstellen. Im Grunde gibts auch kein Problem, weil ich wxWidgets schon oft mit C++ benutzt habe, wenn ich aber mein Script ausführe bekomme ich diesen Error:
Script:

Code: Alles auswählen

#!/usr/bin/env python
import wx
app = wx.PySimpleApp()
frame = wx.Frame(None, wx.ID_ANY, "Hello World !")
frame.Show(True)
app.MainLoop()
Fehler:
'module' object has no attribute '__PySimpleApp'

Ich benutze Ubuntu und habe wxPython und wx installiert.

Edit (Leonidas): Verschoben.

Verfasst: Sonntag 15. Juli 2007, 21:44
von apollo13
komisch bei mir geht das.
Ich verwende auch Ubuntu (7.04) und python-wxversion ist 2.6.3.2.1.5ubuntu6 .

Re: wx PySimpleApp Problem

Verfasst: Sonntag 15. Juli 2007, 22:15
von gerold
MrBigBrain hat geschrieben:'module' object has no attribute '__PySimpleApp'
Hallo MrBigBrain!

Willkommen im Python-Forum!

Dein Python-Modul darf nicht "wx.py" heißen, sonst versucht es sich selbst zu importieren. Zumindest deutet alles darauf hin, dass im Programmordner ein Modul mit diesem Namen existiert. Ich weiß nur noch nicht, woher die zwei Unterstriche "__" (vor PySimpleApp) kommen.

mfg
Gerold
:-)

Verfasst: Sonntag 15. Juli 2007, 22:21
von MrBigBrain
Oh ja schei.. einleuchtend. Vieelen Dank :o

Die zwei Unterstriche sind nur da, weil ich hier eine alte Konsolenausgabe reinkopiert habe. Da hatte ich in meinem Python Modul "__PySimpleApp".