Q:

How can I pass an argument while writing a file using python

I am trying to over-write a file using python and my code looks something like this:
from sys import argv
script = argv
Configuration_file = 'C:/Python33/argv.txt'
f= open(Configuration_file,'w')
f.write('script')

and when I try to run the file using command prompt by using the command 
python argvnew.py roshan,
where argvnew.py is my python file and roshan is my argument. I expect that roshan replaces anything that is written within the argv.txt file mentioned in the program.
Is this the right way to do this?

A:

You can get arguments by calling sys.argv[] array.
sys.argv[0] means script name itself.
You can then write it back to your file, open the file such as here.

