0

I am having trouble in figuring out what's the argv meant in an earlier exercise of Learning Python the Hard Way (exercise 13, I've read the post on Stack Overflow and still can't understand it).

Could someone explain to me what's the meaning of the 3rd line in the code

script, filename=argv

Why is there must be a "script" in the variable argv?

from sys import argv

script, filename = argv

txt = open(filename)

print "Here's your file %r:" % filename
print txt.read()

print "Type the filename again:"
file_again = raw_input("> ")

txt_again = open(file_again)

print txt_again.read()
Community
  • 1
  • 1
MorboRe'
  • 151
  • 10
  • You'll have to be more specific about what you don't understand from the other post, otherwise you'll just get the *exact same explanation here*. – Martijn Pieters May 09 '15 at 22:52
  • You can [edit] your question to make it clearer as to why the other post is not sufficient to explain what is going on. Until such time, this is just a duplicate. – Martijn Pieters May 09 '15 at 22:52
  • go to codeacademy, that's where I first picked up python (and use it for other languages still) – Matthew May 09 '15 at 22:53

0 Answers0