summaryrefslogtreecommitdiff
path: root/python-template.py
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2025-08-21 23:17:49 -0400
committergrothedev <grothedev@gmail.com>2025-08-21 23:17:49 -0400
commit2bda4be0ed395e3ec1605a1ef4e2fcc5b1326089 (patch)
tree0a829c2970b9a82d922e83a029de3d837a9c9584 /python-template.py
parentcaab5b3d52533dc2b03a0d128de186e9c1600f25 (diff)
update wow script to make it way better
Diffstat (limited to 'python-template.py')
-rw-r--r--python-template.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/python-template.py b/python-template.py
new file mode 100644
index 0000000..fda7a42
--- /dev/null
+++ b/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