[Tutor] How can I modify this simple script for argparse?

2012-10-13 Thread Santosh Kumar
Here is a sample script without argparse implementation: from sys import argv script, filename = argv foo = This line was written by a Python script. with open(filename, 'a') as file: file.write(foo) I find argparse hard. Just give me a startup. How can I make a asgparse version?

Re: [Tutor] How can I modify this simple script for argparse?

2012-10-13 Thread Kwpolska
On Sat, Oct 13, 2012 at 7:03 PM, Santosh Kumar sntshkm...@gmail.com wrote: Here is a sample script without argparse implementation: from sys import argv script, filename = argv foo = This line was written by a Python script. with open(filename, 'a') as file: file.write(foo) I find

Re: [Tutor] How can I modify this simple script for argparse?

2012-10-13 Thread Steven D'Aprano
On 14/10/12 04:03, Santosh Kumar wrote: Here is a sample script without argparse implementation: from sys import argv script, filename = argv foo = This line was written by a Python script. with open(filename, 'a') as file: file.write(foo) I find argparse hard. Just give me a startup.