通过Applescript打开终端运行py文件
在py文件前加上一段:#!/usr/bin/env python打开终端输入chmod 777 yourfile.py打开macOS上的脚本编辑器tell application "Terminal"set newTab to do script "cd /Users/..........."do script "./yourfile.py&quo
·
- 在py文件前加上一段:
#!/usr/bin/env python
- 打开终端输入chmod 777 yourfile.py
- 打开macOS上的脚本编辑器
tell application "Terminal"
set newTab to do script "cd /Users/..........."
do script "./yourfile.py" in front window
end tell
然后运行进行测试,可以的话就保存到桌面
更多推荐



所有评论(0)