GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tiny_python_projects/01_hello at master · kevin-s/tiny_python_projects

Expand file tree

/

01_hello

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

01_hello

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Makefile
Makefile
 
 
README.md
README.md
 
 
hello01_print.py
hello01_print.py
 
 
hello02_comment.py
hello02_comment.py
 
 
hello03_shebang.py
hello03_shebang.py
 
 
hello04_argparse_positional.py
hello04_argparse_positional.py
 
 
hello05_argparse_option.py
hello05_argparse_option.py
 
 
hello06_main_function.py
hello06_main_function.py
 
 
hello07_get_args.py
hello07_get_args.py
 
 
hello08_formatted.py
hello08_formatted.py
 
 
test.py
test.py
 
 

README.md

Chapter 1: Hello, World!

https://www.youtube.com/playlist?list=PLhOuww6rJJNP7UvTeF6_tQ1xcubAs9hvO

Write a program to enthusiastically greet the world:

$ ./hello.py
Hello, World!

The program should also accept a name given as an optional --name parameter:

$ ./hello.py --name Universe
Hello, Universe!

The program should produce documentation for -h or --help:

$ ./hello.py -h
usage: hello.py [-h] [-n str]

Say hello

optional arguments:
  -h, --help          show this help message and exit
  -n str, --name str  The name to greet (default: World)

Run pytest -xv test.py (or make test) to ensure you pass all the tests:

$ make test
pytest -xv test.py
============================= test session starts ==============================
...
collected 4 items

test.py::test_exists PASSED                                              [ 25%]
test.py::test_usage PASSED                                               [ 50%]
test.py::test_default PASSED                                             [ 75%]
test.py::test_input PASSED                                               [100%]

============================== 4 passed in 0.41s ===============================
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.