Skip to content

Commit

Permalink
kyclark#5-2 joy.y
Browse files Browse the repository at this point in the history
  • Loading branch information
joy committed Oct 2, 2021
1 parent 050bca1 commit 1a67f3d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions 05_howler/howler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,25 @@ def get_args():
help='Output filename',
metavar='str',
type=argparse.FileType('wt'),
default='')
default=None)

return parser.parse_args()
args = parser.parse_args()

if os.path.isfile(args.input):
args.input = open(args.input).read().rstrip()

return args


# --------------------------------------------------
def main():
"""Make a jazz noise here"""

args = get_args()
str_args = args.input
str_args = args.input.upper()
outfile_args = args.outfile

if os.path.isfile(args.input):
str_args = open(str_args).read()

print(f'{str_args.upper()}', file=outfile_args) if outfile_args else print(f'{str_args.upper()}')
print(f'{str_args}', file=outfile_args) if outfile_args else print(f'{str_args}')


# --------------------------------------------------
Expand Down

0 comments on commit 1a67f3d

Please sign in to comment.