Last active
October 24, 2019 13:37
-
-
Save pykong/7d2c2c058ca4b39069f7c130c4ab60f3 to your computer and use it in GitHub Desktop.
Execute python script on file change in a directory. Useful when coding to instantly get output from the modified code. Setup:
1) Install inotify: sudo apt-get install inotify-tools
2) Make script executable chmod +x pywatch.sh
3) Make script global
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo watch activated | |
inotifywait -qmre modify . | while read f | |
do | |
python $1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment