Browse Source

Merge pull request #11 from tball401/master

Created batsay.py to display an ASCII bat saying something
pull/17/head
Jeffery Russell 6 years ago
committed by GitHub
parent
commit
385f0d2556
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 47 additions and 0 deletions
  1. +47
    -0
      src/batsay.py

+ 47
- 0
src/batsay.py View File

@ -0,0 +1,47 @@
import roosay
import sys
def main():
"""
checks for command line arguments
:return: None
"""
message = ""
for i in range(1, len(sys.argv)):
if len(message) > 0:
message += " "
message += sys.argv[i]
if len(message) == 0:
for line in sys.stdin:
message+= line
message = " ".join(message.split())
batsay(message)
def batsay(message):
"""
prints message through roosay print
message function the prints bat.
:param message: the message to print
:return: None
"""
roosay.print_message(message)
print_bat()
def print_bat():
"""
prints bat ascii
:return: None
"""
print(" \ ")
print(" /\ \ /\ ")
print(" / \\'._ (\_/) _.'/ \ ")
print(" |.''._'--(o.o)--'_.''.|")
print(' \_ / `;=/ " \=;` \ _/ ')
print(" `\__| \___/ |__/` ")
print(" \(_|_)/ ")
print(' " ` " ')
if __name__ == '__main__':
main()

Loading…
Cancel
Save