How to initiate python program with a change in the input?
I have an开发者_如何学C application made in python, this application takes input from a separate text file called input.txt, i have to design the application in such a way that application runs automatically with any input to input.txt. Such that i need not go to command prompt and run the program, if i give the input, or change the text present in input.txt, python program should start execute automatically.
Please help me out with this :)
Thank you :) :)
You can run your program once and watch the filesystem changes for new or modified file. Try using python-inotify for linux:
https://github.com/seb-m/pyinotify
精彩评论