以root权限运行以下命令:
find /your/path/ -type f -name "*.py" -exec chmod u+x {} \;
chmod
如果您是.py
文件的所有者,则无需以root用户身份运行。
编写脚本来解决这个问题。
#!/bin/bash
if [ -f "$1" ]
then
geany "$1" # You Could also use xdg-open if you set geany to open .py files
else
cp /path/to/python/startup/template "$1" # You may omit this if you don't have a default template
chmod u+x "$1"
geany "$1"
fi
将脚本另存为,pycreator
例如/usr/bin/
,然后说
chown root:root /usr/bin/pycreator
chmod +x-w /usr/bin/pycreator
要使用创建新脚本pycreator
,请执行
pycreator calculator.py