I’m a newbie with python and just starting with wxPython.
I have some basic beginner code using wxPthon which runs fine in any other directory but the Aptana Workspace directory (or its subdirectories). Copy and paste the file – double-click on the file name with the mouse and it runs – but ONLY if the file is not in the Aptana workspace directory.(It makes no difference if Aptana is running or not) What is going on?
#!/usr/bin/python
# simple.py
import wx
app = wx.App()
frame = wx.Frame(None, -1, 'simple.py')
frame.Show()
app.MainLoop()
A probably related problem is that with wxPython in PyDev I’m getting similar errors to some other users – "Undefined variable from import:App" (or anything else with a wx.prefix.)
I’ve tried all the suggestions in Undefined variable from import when using wxPython in pydev eg reinstalling the python interpreter into PyDev, checking that wx-2.8-msw-unicode is correctly indicated on the System PYTHONPATH, ensuring that wxPython is included in the forced builtins. I've also done a few restarts, just in case...
I've also tried a couple of suggested hacks - Ctrl+1 comments on the error lines, even wx=wx (both remove the red error icons but the program still doesn't run .... “AttributeError: 'module' object has no attribute 'App'” when I try to run the program from Aptana)
Since the file runs OK outside the Aptana Workspace, there's obviously something about the Aptana Workspace that I don't understand. Has anyone got any suggestions?
Windows Vista Python 2.7 Aptana Studio 3