From ca110b2c395363659f4e5c82f5fad769f9d255da Mon Sep 17 00:00:00 2001 From: Detlef Groth Date: Fri, 22 Nov 2024 04:29:23 +0100 Subject: [PATCH] slightly extending main abbreviation for python.eaf --- jasspa/macros/python.eaf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jasspa/macros/python.eaf b/jasspa/macros/python.eaf index 4967dd2..2d439bc 100644 --- a/jasspa/macros/python.eaf +++ b/jasspa/macros/python.eaf @@ -1,5 +1,5 @@ "" " \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" @@ -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"