Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the simplest way to put a python script into the system tray (Windows)

What's the simplest way to put a python script into the system tray?

My target platform is Windows. I don't want to see the 'cmd.exe' window.

like image 420
Alterlife Avatar asked Jul 06 '09 06:07

Alterlife


People also ask

Where do I put Python scripts in Windows?

On recent versions of Windows, it is possible to run Python scripts by simply entering the name of the file containing the code at the command prompt: C:\devspace> hello.py Hello World!

How do I pin a Python script to the taskbar?

Click the Start button, go to All apps and find your file there. Right click it and select “Pin to Start”.

How do I install .py files on Windows?

To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.


1 Answers

Those are two questions, actually:

  1. Adding a tray icon can be done with Win32 API. Example: SysTrayIcon.py
  2. Hiding the cmd.exe window is as easy as using pythonw.exe instead of python.exe to run your scripts.
like image 135
Assaf Lavie Avatar answered Sep 19 '22 13:09

Assaf Lavie