2

I want to monitor a file in a specific location and check it for updates, which upon being updated launches certain actions via a python script.

Ideally, this program would always be running in the background and would automatically start with the computer so that the user does not have to mess with starting/stopping it.

I have researched the topic some and have found daemon and similar tools, but I do not understand how they work and they look far more complex then what I need. Also, many of the examples that I am looking at use Ubuntu OS and I will be using Windows.

Are there any python modules that exist to do this already or any direction you can point me to get started? I apologize if this question has been answered already, however I have not found it in my research.

I plan on editing this post to include code that performs this action, however I currently do not know where to start.

paperstsoap
  • 335
  • 4
  • 13
  • @MatthewMiles Looking at that post, the question at startup or at login is a good question. Ultimately would the processes be the same if it where to start at login? – paperstsoap Nov 15 '19 at 18:01
  • I can't answer that sorry, please open a new question which is more specific if the linked question doesn't anwer your issue. @paperstsoap – Matthew Miles Dec 05 '19 at 18:33

1 Answers1

1

On Windows you could create a batch script and schedule it using the Windows Task Scheduler to run as a process on boot.

You can trigger the Python script to run inside the batch file,

python file.py

Alternatively, if you're using something like Anaconda as your environment manager; you could write a batch file to activate Anaconda using the activate.bat contained in the Scripts folder of your Anaconda installation path and then follow the usual calling steps.

Akash Sonthalia
  • 362
  • 2
  • 12