Skip to content

Commit

Permalink
slightly extending main abbreviation for python.eaf
Browse files Browse the repository at this point in the history
  • Loading branch information
Detlef Groth committed Nov 22, 2024
1 parent ac2c3b9 commit ca110b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jasspa/macros/python.eaf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"" "</FOLD><FOLD+> \ecCControl Flow:\ecA"
main "#!/usr/bin/env python3\r# -*- coding: ISO-8859-15 -*-\r\"\"\"\pModule docstring\"\"\"\r__author__ = \"first last\"\r__version__ = \"0.1\"\rimport sys, os, re\r\rdef usage(argv):\r\Tprint(f\"Usage: {argv[0]} args\")\r\r\Tprint(__doc__)\r\rdef main(argv):\r\Tif (len(argv)) == 1:\r\Tusage(argv)\r\rif __name__ == \"__main__\":\r\Tmain(sys.argv)\r\r\P" " main"
main "#!/usr/bin/env python3\r# -*- coding: ISO-8859-15 -*-\r\"\"\"\pModulename\r\rUsage: {0} ?-h,-?,--help?\r\rArguments:\r\"\"\"\r__author__ = \"first last\"\r__version__ = \"0.1\"\rimport sys, os, re\r\rdef help(argv):\r\Tprint(__doc__.format(argv[1]))\r\rdef usage(argv):\r\Tprint(f\"Usage: {argv[0]} args\")\r\rdef main(argv):\r\Tif (len(argv)) == 1:\r\Tusage(argv)\r\r\Telif \"-h\" in argv or \"--help\" in argv:\r\Thelp(argv)\r\rif __name__ == \"__main__\":\r\Tmain(sys.argv)\r\r\P" " main"
enc "# -*- coding: ISO-8859-\p -*-\r\P" " enc"
enc15 "# -*- coding: ISO-8859-15 -*-\r" " enc15"
enc1252 "# -*- coding: cp1252 -*-\r" " enc1252"
Expand All @@ -14,6 +14,7 @@ eli "elif \p:\P" " eli(f)"
els "else:\r\T" " els(e)"
whi "while (\p):\r\P" " whi(le)"
for "for \p in range(10):\P" " for"
l2d "dct=dict({})\rfor i in range(1,len(\plst),2):\r\Tkey = lst[i]\rval = lst[i+1]\rdct[key]=val\r\P" " l2d"
iffile "if not os.path.isfile(\p):\P" " iffile"
openr "file = open(\p,'r')\rfor line in file:\r print(line)\rfile.close()\r\P" " openr"
openw "out = open(\p,'w')\rout.write('')\rout.close()\r\P" " openw"
Expand Down

0 comments on commit ca110b2

Please sign in to comment.