Run Python app at startup

S

SMALLp

Hy.
I create simple application. Yust an windows and "compile" it with
py2exe. I add registry value
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v
MyApp /t REG_SZ /d C:\myapp.exe /f'

And it wont start. When i use console instead od window in py2exe i get
console opend but it closes.

Program:
<code prog.py>
import os
import wx

app = wx.App()
frame = wx.Frame(None, -1, "MyFrame")
frame.Show()

app.MainLoop()
</code>

Then in commang prompt:

python.exe setup.py py2exe


<code of setup.py>
from distutils.core import setup
import py2exe

setup(console=['prog.py'])
</code>

Help please!
 
D

dave_mikesell

Hy.
I create simple application. Yust an windows and "compile" it with
py2exe. I add registry value
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v
MyApp /t REG_SZ /d C:\myapp.exe /f'

And it wont start. When i use console instead od window in py2exe i get
console opend but it closes.

Program:
<code prog.py>
import os
import wx

app = wx.App()
frame = wx.Frame(None, -1, "MyFrame")
frame.Show()

app.MainLoop()
</code>

Then in commang prompt:

python.exe setup.py py2exe

<code of setup.py>
from distutils.core import setup
import py2exe

setup(console=['prog.py'])
</code>

Don't you have to include the wxPython code somehow, perhaps on the
command line when building the exe?
 
G

Gabriel Genellina

Hy.
I create simple application. Yust an windows and "compile" it with
py2exe. I add registry value
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
/v
MyApp /t REG_SZ /d C:\myapp.exe /f'

And it wont start. When i use console instead od window in py2exe i get
console opend but it closes.

I'd check in this order:

python prog.py
Then, use console=... in setup.py, generate prog.exe
Open a cmd window and execute prog.exe (from the dist directory)
Repeat using window=... in setup.py

That whole sequence works fine using on my WinXP SP2 + Python 2.5.1
+ wxPython 2.8.7.1
 
S

SMALLp

Gabriel said:
I'd check in this order:

python prog.py
Then, use console=... in setup.py, generate prog.exe
Open a cmd window and execute prog.exe (from the dist directory)
Repeat using window=... in setup.py

That whole sequence works fine using on my WinXP SP2 + Python 2.5.1 +
wxPython 2.8.7.1
Program works fine. When i run it it works. Problem is how to make this
aplication start at windows startup. It opens and it closes in my case.
 
G

Gabriel Genellina

Program works fine. When i run it it works. Problem is how to make this
aplication start at windows startup. It opens and it closes in my case.

Redirect stdout and stderr to some log file so you can inspect it and see
the error:

cmd /c c:\path\myapp.exe >c:\path\output.log 2>&1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top