jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

add shebang and exe-attribute #530

Open KM-200 opened 6 years ago

KM-200 commented 6 years ago

so the .py files are run via click-to-launch in dolphin filemanager:

#!/bin/bash
rm                         /tmp/_xx
echo -e "#!/usr/bin/python3 \n# -*- coding: utf-8 -*- \n" > ./shebangPYheader
for FILE in $(find ./examples/ -maxdepth 5 -type f -name "*.py"); do
  chmod +x $FILE
  cat ./shebangPYheader >> /tmp/_xx ;  cat $FILE >> /tmp/_xx ;  cat /tmp/_xx  > $FILE
  rm                       /tmp/_xx
done

now the example files can be clicked and run nicely ! Even those containing "\n" which will not be converted to a real linefeed, which would have been breaking some programs in alternate scripting.

KM-200 commented 6 years ago

here is a second way to do the same thing:

https://github.com/KM-200/appJar/wiki