Hi all
I am trying to figure out how to run my wxPython app automatically on
startup - Linux only (FC5).
On a separate track I am figuring out how to set up a diskless workstation.
Eventually I will combine the two, so that I can have a diskless workstation
that just runs my app. It will be ideal for point-of-sale and similar
systems.
My question relates to running the app automatically on startup. Bear in
mind that I don't really know what I am doing, so any advice as to the
*correct* way to do it will be most welcome. However, after some googling I
have got something that looks promising, but I have a specific question.
I am separating the steps of 'logging in automatically', and 'running a gui
program automatically', so the following commands are run after I have
logged into a text-based console -
X :0 < /dev/null > /dev/null 2>&1 &
exec demo.py --display :0 &
This brings up a gui screen with just the wxPython demo running. It seems to
run fine.
If I change the second line to exec myapp.py instead of demo.py, I get the
following error (I typed this, so I hope there are no typos) -
Traceback (most recent call last):
File "./myapp.py", line 1135, in ?
app = MyApp(False)
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 7700, in __init__
self.BootstrapApp()
File "/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 7352, in _BootStrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
SystemError: wxEntryStart failed, unable to initialize wxWidgets! (Is
DISPLAY set properly?)
As far as I can see the essentials are the same as Main.py (called from
demo.py) -
import wx
class MyApp(wx.App):
def OnInit(self):
frame = MainFrame()
frame.CentreOnScreen()
frame.Show(False)
self.SetTopWindow(frame)
return True
app = MyApp(False)
app.MainLoop()
Any suggestions will be appreciated.
Thanks
Frank Millman