Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3561307

Browse files
committed
ch05: outfile option
1 parent 562f832 commit 3561307

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

05_howler/howler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def main():
3434
outfile_arg = args.outfile
3535
input_arg = args.input
3636

37-
print(input_arg.upper())
37+
if outfile_arg != "":
38+
out_fh = open(outfile_arg, "wt")
39+
out_fh.write(input_arg.upper())
40+
out_fh.close()
41+
else:
42+
print(input_arg.upper())
3843

3944

4045
# --------------------------------------------------

0 commit comments

Comments
 (0)