So i have a python script that automate some checks and send a mail when finished.
I start the script with windows scheduler every night.
I want to log if the script ran from the scheduler or if someone ran it manualy from an IDE(PyCharm for my case)
Is there any os method that returns how a script ran or something else maybe?
while scheduling from windows scheduler you can send a command line argument, then check it in your code if it is started with specified command line argument then it is run from windows scheduler.
Can my python script know if it started manualy from IDE or automatically from scheduler?