Thanks,
However the brackets make no difference. The code (such as it is) runs
using wxPython 3 (PyApp changed to App). I can show the problem is
related to the way the wxApp is created. By creating the wxApp instance
before invoking the python interpreter "it works".
I am minded to give up until wxPython 4 is stable.
Bazza
Testing this on Window 10:
> ipython
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32
bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 5.5.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import wx
In [2]: pa = wx.PyApp
In [3]: pa.IsDisplayAvailable()
Out[3]: True
In [4]: frame=wx.Frame(None,wx.ID_ANY,"Test")
···
On 29/01/2018 18:13, Bazza Hill wrote:
---------------------------------------------------------------------------
PyNoAppError Traceback (most recent call last)
<ipython-input-4-bff7e941f974> in <module>()
----> 1 frame=wx.Frame(None,wx.ID_ANY,"Test")
PyNoAppError: The wx.App object must be created first!
In [5]: app = wx.App()
In [6]: frame=wx.Frame(None,wx.ID_ANY,"Test")
In [7]: del frame
In [8]: exit
Steve-Gadget@MOON C:\Users\Steve-Gadget
> ipython
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32
bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 5.5.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import wx
In [2]: pa = wx.PyApp()
In [3]: frame=wx.Frame(None,wx.ID_ANY,"Test")
In [4]: exit
Steve-Gadget@MOON C:\Users\Steve-Gadget
> c:\Python36_64\Scripts\ipython.exe
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit
(AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import wx
In [2]: pa = wx.PyApp()
In [3]: frame=wx.Frame(None,wx.ID_ANY,"Test")
In [4]: exit
Steve-Gadget@MOON C:\Users\Steve-Gadget
> c:\Python36_64\python -c "import wx;print(wx.version());"
4.0.0b2 msw (phoenix)
Steve-Gadget@MOON C:\Users\Steve-Gadget
> python -c "import wx;print(wx.version());"
4.0.0b1 msw (phoenix)
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.