summaryrefslogtreecommitdiff
path: root/templates/python-template.py
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2026-04-25 21:12:00 +0000
committerGitHub <noreply@github.com>2026-04-25 21:12:00 +0000
commit00a8a558aa2984401728c5027cf054b9d7a97b6f (patch)
treeed10fcc4dd1153d983164bff9523f594b4d63ff8 /templates/python-template.py
parent6694a4948df344df8d080a277e6fdf51cbef4274 (diff)
Organize low-risk repo assets
Agent-Logs-Url: https://github.com/grothedev/randomscripts/sessions/5da26845-b606-4f8f-8fcb-488a29119f51 Co-authored-by: grothedev <5280051+grothedev@users.noreply.github.com>
Diffstat (limited to 'templates/python-template.py')
-rw-r--r--templates/python-template.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/templates/python-template.py b/templates/python-template.py
new file mode 100644
index 0000000..fda7a42
--- /dev/null
+++ b/templates/python-template.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python3
+
+import argparse
+import sys
+
+#this is a template for a python program that can be run from command line or used as a module
+
+def parseArgs():
+ parser = argparse.ArgumentParser(description='the program does a thing')
+ parser.add_argument('-v', '--verbose', action='store_true', help='verbose')
+ parser.add_argument('-i', '--input', type=str, required=True, help='input file')
+ parser.add_argument('-o', '--output', type=str, required=False, help='output file')
+ args = parser.parse_args()
+ return args
+
+def main():
+ args = parseArgs()
+ if args.verbose:
+ print(f"Input file: {args.input}")
+ if args.output:
+ print(f"Output file: {args.output}")
+
+
+
+
+if __name__ == '__main__':
+ main() \ No newline at end of file