当文件更改时自动重新运行Python应用程序。
项目描述
repyt
当文件更改时自动重新运行Python命令。
安装
pip install repyt
用法
repyt [-h] [--command COMMAND] [args]
位置
COMMAND Any command to execute in the shell, as a string. This doesn't even have to be a Python command! args Arguments as you would normally pass to the `python` command. -h or --help Show this help message and exit.
示例
就像使用python
命令一样使用它
repyt hello_world.py
包括参数是完全可以的
repyt hello_world.py --world="Earth"
这相当于
repyt -c 'python hello_world.py --world="Earth"'
命令参数甚至不必是Python命令
repyt -c 'echo "Yo Adrian! I did it!"'
描述
repyt检测当前目录和子目录中的更改,当文件被您或您的编辑器更改时,将重新运行您的Python脚本、应用程序或任何其他命令。
它友好地忽略了隐藏文件和其他可能不重要的东西。
如果可能的话,您应该像使用python
命令一样使用它。