This is my python hello.py script:
def hello(a,b):
print "hello and that's your sum:"
sum=a+b
print sum
import sys
if __name__ == "__main__":
hello(sys.argv[2])
The problem is that it can't be run from the windows command line prompt, I used this command:
C:\Python27>hello 1 1
But it didn't work unfortunately, may somebody please help?
PATHdirectory, and runninghello 1 1doesn't pass the command-line arguments, then the .py file association is broken. If CMD or PowerShell doesn't find "hello.py", then .PY isn't inPATHEXT. You should not need to runpython hello.py 1 1. That's annoying since it requires using a qualified path for hello.py or changing to its directory first. - Eryk Sun