won't start with pythonw
See original GitHub issueI wrote a simple service, and tried to deploy it on windows. I used pythonw.exe to start the script. But bottle won’t start. The process started and then quickly closed. But if I started it using python.exe, the process works fine. I think this might be a bug. The process won’t start even if I just imported bottle but not doing anything. The code looks like this. pythonw hello_world.py would start, and then quickly shutdown.
'''
hello_world.py
'''
import bottle
import time
if __name__ == '__main__':
while True:
print('Hello, world')
time.sleep(2)
However, python hello_world.py will do the work, and if I comment import bottle out, pythonw will do the job too.
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (3 by maintainers)
Top Results From Across the Web
pyw and pythonw does not run under Windows 7
pyw python file causes python.exe to show up under Task Manager. How do we troubleshoot the problem? The system is running Python 2.7....
Read more >Issue 7817: Pythonw.exe fails to start - Python tracker
Pythonw.exe refuses to start on my Windows 7 x64 computer. ... has stopped working"), it simply doesn't open. python.exe works fine.
Read more >How To Fix Annoying Pythonw.exe Errors [SOLVED] - Solvusoft
In most cases, pythonw.exe file problems are due to the file missing or being corrupted (malware / virus) and often seen at Python...
Read more >[Resolved] Pythonw.exe has Stopped Working - Python Pool
Often, python developers face a challenging issue while resolving pythonw.exe stopped working issue. Here, we will be fixing that issue.
Read more >Installation Successful, but pythonw and idle doesn't function
I also attempted to run "idle", with the following results: C:\Users\judy\AppData\Local\Programs\Python\Python35-32\Lib\idlelib>idle.py ** IDLE can't import ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Running a server on windows is a pretty common use case for pythonw.exe (the other is GUI apps). So there is good reason to run a bottle application without a console.
You can add:
to your app before you import bottle.
For some reason, nothing that gets written to stdout/stderr actually shows up in the files once bottle is imported, but aside from that it seems to work.
@seth-c-stenzel For it to work, you have to do it in this order:
Can you confirm it works for you?