From 98b57f380d4bedbbe9a0eea174075f8c62aea6bd Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 21 Jun 2017 06:54:58 -0400 Subject: Moved example scripts from examples to examples/scripts directly Cleaned up the examples directory by adding a scripts subdirectory. This makes it a bit clearer which Python files are example cmd2 applications and which are example Python scripts for use with the pyscript command. --- examples/scripts/arg_printer.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 examples/scripts/arg_printer.py (limited to 'examples/scripts/arg_printer.py') diff --git a/examples/scripts/arg_printer.py b/examples/scripts/arg_printer.py new file mode 100755 index 00000000..848dcf99 --- /dev/null +++ b/examples/scripts/arg_printer.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# coding=utf-8 +import os +import sys +print("Running Python script {!r} which was called with {} arguments".format(os.path.basename(sys.argv[0]), + len(sys.argv) - 1)) +for i, arg in enumerate(sys.argv[1:]): + print("arg {}: {!r}".format(i+1, arg)) -- cgit v1.2.1