How to determine if a Python script is being run right after startup on Windows

Krister Svanlund krister.svanlund at
Tue Sep 7 12:19:02 CEST 2010

On Tue, Sep 7, 2010 at 11:43 AM, Dennis Verdonschot <thossie at> wrote:
> Hi Ryan,
> Maybe I'm missing something, but wouldn't creating a shortcut and
> putting that shortcut in your Start - Programs - Startup section of
> the Windows menu not work for this program? Or if really needed you
> can edit the start-up programs in the registry.
> If you add some logging ability to your program you can verify it has
> been run and you can still use commandline arguments by changing the
> shortcut.
> --
> Dennis
> --

I would recommend using a commandline switch (look at sys.argv in
documentation) and just start the script with something like
python --change-wallpaper
or maybe require a switch for getting to the GUI...

More information about the Python-list mailing list