Skip to content

Commit

Permalink
initial snakesay project add
Browse files Browse the repository at this point in the history
  • Loading branch information
iansedano committed Oct 25, 2024
1 parent 565dfd1 commit 3db3e17
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
Empty file added python-pyproject-toml/README.md
Empty file.
10 changes: 10 additions & 0 deletions python-pyproject-toml/snakesay-project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "snakesay"
version = "1.0.0"

[project.scripts]
snakey = "snakesay.__main__:main"
9 changes: 9 additions & 0 deletions python-pyproject-toml/snakesay-project/snakesay/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sys

from snakesay import snake

def main():
snake.say(" ".join(sys.argv[1:]))

if __name__ == "__main__":
main()
22 changes: 22 additions & 0 deletions python-pyproject-toml/snakesay-project/snakesay/snake.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SNAKE = r""" \
\ __
\ {oo}
(__)\
λ \\
_\\__
(_____)_
(________)=Oo°
"""


def bubble(message):
bubble_length = len(message) + 2
return f"""
{"_" * bubble_length}
( {message} )
{"‾" * bubble_length}"""


def say(message):
print(bubble(message))
print(SNAKE)

0 comments on commit 3db3e17

Please sign in to comment.