Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- # This gives us script and filename as variables to use
- # which are given when the script is called.
- script, filename = argv
- # This assigns open(filename) to the function txt.
- txt = open(filename)
- # This prints our line and calls to print the raw data
- # given from filename.
- print "Here's your file %r:" % filename
- # This tells txt to read (print) the file.
- print txt.read()
- # Notes
- #
- # I'm not sure why I can't replace txt.read() with
- # open(filename).read() and have it work the same way...
Add Comment
Please, Sign In to add comment