开发者

How to initiate python program with a change in the input?

开发者 https://www.devze.com 2023-03-05 12:55 出处:网络
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 automa

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号