Add Python demo and move demos to their own subdir

This commit is contained in:
Samuel Sloniker 2022-04-08 13:48:22 -07:00
parent 3d985edb5a
commit 37786d41c1
3 changed files with 15 additions and 1 deletions

View File

@ -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

13
demos/python.py Normal file
View File

@ -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)