Created
November 4, 2012 13:07
-
-
Save funrep/4011824 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this code: | |
import argparse | |
parser = argparse.ArgumentParser(prog='cat.py') | |
parser.add_argument('file', help='file to print and catenate') | |
main(): | |
args = parser.parse_args() | |
file = open(args.file, 'r').read() | |
print file | |
if __name__ == '__main__': | |
main() | |
# gives me this error: | |
# $ ./cat.py | |
# File "./cat.py", line 14 | |
# main(): | |
# ^ | |
# SyntaxError: invalid syntax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment