Skip to content

Commit f12f35e

Browse files
committed
add file cli.py
1 parent 1582f86 commit f12f35e

File tree

7 files changed

+12
-2
lines changed

7 files changed

+12
-2
lines changed
6 Bytes
Binary file not shown.
397 Bytes
Binary file not shown.

brain_games/cli.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import prompt
2+
3+
4+
def welcome_user():
5+
print("Welcome to the Brain Games!")
6+
name = prompt.string('May I have your name? ')
7+
print(f"Hello, {name}!")
6 Bytes
Binary file not shown.
28 Bytes
Binary file not shown.

brain_games/scripts/brain_games.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
1+
#! /usr/bin/env python3
22
# brain_games/scripts/brain_games.py
33

4+
from brain_games.cli import welcome_user
5+
46
def main():
5-
print("Welcome to the Brain Games!")
7+
welcome_user()
68

79
if __name__ == "__main__":
810
main()

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ packages = [
1010

1111
[tool.poetry.dependencies]
1212
python = "^3.9"
13+
prompt = "^0.4.1"
1314

1415
[tool.poetry.scripts]
1516
brain-games = "brain_games.scripts.brain_games:main"

0 commit comments

Comments
 (0)