Skip to content
Permalink
Browse files

cat function for windows (for demo purposes)

  • Loading branch information...
DavidCEllis committed Sep 17, 2016
1 parent 0b5bcfe commit 15408b80b6213040dde00f4b70e1f9aca678eda4
Showing with 21 additions and 0 deletions.
  1. +21 −0 cat_python.py
@@ -0,0 +1,21 @@
"""Basic cat in python - with extra emojis"""


def cat(*args, encoding=None):
for fn in args:

meow = b''
f = open(fn, 'rb')
try:
meow += f.read()
finally:
f.close()

if encoding:
meow.decode(encoding)

return meow


def onelinecat(*args):
return b''.join(open(fn, 'rb').read() for fn in args)

0 comments on commit 15408b8

Please sign in to comment.
You can’t perform that action at this time.