Prompting and Passing
It should be:
script, user = argv[0], argv[1]
argv is a list, and argv[0] is the name of the script, while argv[1] (and [2], [3], etc.) are the parameters given to the script
My Gamedev Journal: 2D Game Making, the Easy Way
---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)
How are you invoking the script?
devstropo.blogspot.com - Random stuff about my gamedev hobby
You should call the script through a terminal somewhat like this:
python "new 1.txt" your_name_here
Also, it might be easier if the name of the script doesn't contain any spaces, something like new_1.txt, then you could call it without the quotes:
python new_1.txt your_name_here
In both cases, the your_name_here argument will be in the argv[1].
devstropo.blogspot.com - Random stuff about my gamedev hobby
Your first line to invoke the script from the terminal window was almost correct. You were just in the wrong directory (hence the error that python gave you "No such file or directory"; it couldn't find "new 1.txt" from its current location). It looks like your file "new 1.txt" is in the folder C:\Users\ahmed\Desktop\, so you'll need to navigate to that directory before you run python. This can be done with the cd command (short for change directory):
PS C:\User\ahmed> cd Desktop
PS C:\User\ahmed\Desktop> python "new 1.txt" koka282