From 37786d41c138d47584273a8a2bc7f74ad73b9b60 Mon Sep 17 00:00:00 2001 From: Sam Sloniker Date: Fri, 8 Apr 2022 13:48:22 -0700 Subject: [PATCH] Add Python demo and move demos to their own subdir --- README.md | 3 ++- demos/python.py | 13 +++++++++++++ demo_script.sh => demos/shell.sh | 0 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 demos/python.py rename demo_script.sh => demos/shell.sh (100%) diff --git a/README.md b/README.md index 8897906..6ca4f0a 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,5 @@ particular, HTTP response codes are ignored (see #1). git clone https://git.kj7rrv.com/kj7rrv/netrun cd netrun pip3 install -r requirements.txt - python3 netrun.py https://git.kj7rrv.com/kj7rrv/netrun/raw/branch/master/demo_script.sh + python3 netrun.py https://git.kj7rrv.com/kj7rrv/netrun/raw/branch/master/demos/shell.sh + python3 netrun.py --interpreter=python3 https://git.kj7rrv.com/kj7rrv/netrun/raw/branch/master/demos/python.py diff --git a/demos/python.py b/demos/python.py new file mode 100644 index 0000000..a33df2e --- /dev/null +++ b/demos/python.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +import platform +import textwrap +import os + +language = f"Python {platform.python_version()}" +operating_system = f"{platform.system()} {platform.release()}" +machine = f"a system with a(n) {platform.processor()} processor" + +message = f"You are running {language} on {operating_system} on {machine}." + +for line in textwrap.wrap(message, os.get_terminal_size().columns): + print(line) diff --git a/demo_script.sh b/demos/shell.sh similarity index 100% rename from demo_script.sh rename to demos/shell.sh