option argument length

2005-12-04 Thread Ritesh Raj Sarraf
: (options,args) = parser.parse_args() len(options) != 1 or len(options) 2: print Incorrect number of arguments passed. How do I accomplish it ? Regards, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Stealing logics from one person is plagiarism, stealing from many

Re: option argument length

2005-12-05 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Marc 'BlackJack' Rintsch on Monday December 5 2005 03:24 wrote: In [EMAIL PROTECTED], Ritesh Raj Sarraf wrote: My program uses mostly option arguments hence my len(args) value is always zero. I need to check if the user has passed the correct

Re: option argument length

2005-12-05 Thread Ritesh Raj Sarraf
have multiple options but I have parser.set_defaults() for each of them. Regards, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Stealing logics from one person is plagiarism, stealing from many is research. Necessity is the mother of invention. Note: Please CC me. I'm

Re: option argument length

2005-12-07 Thread Ritesh Raj Sarraf
On Tue, 6 Dec 2005, Peter Otten wrote: Ritesh Raj Sarraf wrote: I'm using this for option arguments which are mutually inclusive. But I want the user to pass atleast one option argument for the program to function properly. For example, I have an option --fetch-update which requires a file

Re: option argument length

2005-12-07 Thread Ritesh Raj Sarraf
a default value. So I want to check what the user has passed. But unfortunately the args variable has 0 as its value always. Is my way (up till now) of using optparse logically incorrect or improper ? Regards, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Stealing logics from

urllib2.urlopen Progress bar

2006-01-14 Thread Ritesh Raj Sarraf
(temp.headers['Content-Length']) #prog = progressBar(0, lastval, 77) # #for x in range(101): #prog.updateAmount(x) #print prog, \r, time.sleep(0.5) # #data = open(sFile,'wb') #data.write(temp.read()) #data.close() #temp.close() Regards, Ritesh - -- Ritesh Raj Sarraf RESEARCHUT -- http

[FIXED] Re: urllib2.urlopen Progress bar

2006-01-15 Thread Ritesh Raj Sarraf
() temp.close() Thanks, Ritesh Ritesh Raj Sarraf on Sunday 15 Jan 2006 12:55 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, In urllib.urlretrieve I can use reporthook to implement a progress bar. But in urllib2.urlopen I can't. I have to use urllib2.urlopen because

breaking from loop

2006-02-09 Thread Ritesh Raj Sarraf
Hi, Following is the code: def walk_tree_copy(sRepository, sFile, sSourceDir, bFound = None): try: if sRepository is not None: for name in os.listdir(sRepository): path = os.path.join(sRepository, name) if os.path.isdir(path):

Re: breaking from loop

2006-02-10 Thread Ritesh Raj Sarraf
Thanks to everyone. It is really the best place and the best people to learn from. Here's what I followed from the discussion: def files(root): for path, folders, files in os.walk(root): for file in files: yield path, file def copy_first_match(repository, filename,

urllib.urlretireve problem

2005-03-26 Thread Ritesh Raj Sarraf
Please Help! rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Gnupg Key ID: 04F130BC Stealing logic from one person is plagiarism, stealing from many is research. -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCRcCk4Rhi6gTxMLwRAlb2AJ0fB3V5ZpwdAiCxfl

Re: urllib.urlretireve problem

2005-03-30 Thread Ritesh Raj Sarraf
if it downloaded the desired file. I think my problem is fixable in urllib.urlopen, I just find urllib.urlretrieve more convenient and want to know if it can be done with it. Thanks for responding. rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Gnupg Key ID: 04F130BC Stealing logic from

Re: urllib.urlretireve problem

2005-03-31 Thread Ritesh Raj Sarraf
cetera. That is why I'm sticking strictly to python libraries. The second suggestion sounds good. I'll look into that. Thanks, rrs - -- Ritesh Raj Sarraf RESEARCHUT -- http://www.researchut.com Gnupg Key ID: 04F130BC Stealing logic from one person is plagiarism, stealing from many is research

Module imports during object instantiation

2007-08-10 Thread Ritesh Raj Sarraf
Hi, I've been very confused about why this doesn't work. I mean I don't see any reason why this has been made not to work. class Log: def __init__(self, verbose, lock = None): if verbose is True: self.VERBOSE = True else: self.VERBOSE = False if lock

Re: Module imports during object instantiation

2007-08-11 Thread Ritesh Raj Sarraf
On Aug 11, 3:17 am, James Stroud [EMAIL PROTECTED] wrote: You do realize your import statement will only be called for nt and dos systems don't you? Yes. I would like to load a Windows Python Module (which is, say a specific implementation for Windows only) in such a condition where I find

Re: Module imports during object instantiation

2007-08-13 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: Ritesh Raj Sarraf a écrit : if lock is None or lock != 1: self.DispLock = False else: self.DispLock = threading.Lock() self.lock = True if os.name == 'posix': self.platform = 'posix

Re: Module imports during object instantiation

2007-08-13 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: Ritesh Raj Sarraf a écrit : The initializer will be called *each time* you instanciate the class. And nothing prevents client code from calling it explicitelly as many times as it wants - ok, this would be rather strange, but this is still technically possible

Re: Module imports during object instantiation

2007-08-13 Thread Ritesh Raj Sarraf
Steve Holden wrote: Ritesh Raj Sarraf wrote: class Log: def __init__(self, verbose, lock = None): if verbose is True: self.VERBOSE = True else: self.VERBOSE = False Better: self.VERBOSE = verbose or, if you suspect verbose might pass in a mutable

Re: Module imports during object instantiation

2007-08-14 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: What's leading you to conclude the import isn't being executed? You realise, I trust, that the module's code will only be executed on the first call to __init__()? Well. Putting it in a try inside __init__() doesn't do anything. This would be highly suprising.

Re: Module imports during object instantiation

2007-08-14 Thread Ritesh Raj Sarraf
Neil Cerutti wrote: If you want an import inside an __init__ to run, you must call the __init__ function that contains it. Doesn't __init__ get called automatically ? I thought __init__ was required to be called explicitly only when you were doing inheritance and wanted to pass separate values

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
Neil Cerutti wrote: Doesn't __init__ get called automatically ? It gets called automatically when you construct an instance of the class in which it's defined. I am a little confused by your statements now. In my earlier posts in the same thread, I gave some code example which was

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
On Aug 15, 11:42 pm, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-15, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: Or am I terribly missing something that you are trying to tell ? I didn't see log = Log() in your example. Sorry for the excursion. Are you sure os.name is 'posix' on your

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
On Aug 16, 12:16 am, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: On Aug 15, 11:42 pm, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-15, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: Or am I terribly missing something that you are trying to tell ? I didn't see log = Log() in your example

Re: Module imports during object instantiation

2007-08-16 Thread Ritesh Raj Sarraf
Steve Holden wrote: Ritesh Raj Sarraf wrote: On Aug 16, 12:16 am, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: On Aug 15, 11:42 pm, Neil Cerutti [EMAIL PROTECTED] wrote: [...] Oops!!! Looks like I completely missed this. It _did_ print the error message. Apologies to all for not keeping

Re: Python Debugger / IDE ??

2006-03-16 Thread Ritesh Raj Sarraf
Can you please point some good documents (need not be Python specific) on best practices with writing code this way ? Thanks, Ritesh -- http://mail.python.org/mailman/listinfo/python-list

Namespace issue

2007-05-23 Thread Ritesh Raj Sarraf
Hi, I need a little help in understanding how Namespaces and scoping works with Classes/Functions in Python. Here's my code: class FetchData: def __init__(self, dataTypes=[foo, bar, spam], archive=False): self.List = [] self.Types = dataTypes if

determining file type

2006-06-14 Thread Ritesh Raj Sarraf
Hi, I have a funtion named unzipper() which does the work of unzipping the files. Is there a way I can identify what is the type of the file which'll be passed to unzipper(). If yes, I'll be able to make out if it's a zip file or a tar or a bz2 file. Thanks, Ritesh --

Re: determining file type

2006-06-14 Thread Ritesh Raj Sarraf
But isn't there any library function ? Something like XX.filetype(name) Directory File-Tar File-Zip File-MPEG Ritesh Maric Michaud wrote: Le Mercredi 14 Juin 2006 11:22, Ritesh Raj Sarraf a écrit : Hi, I have a funtion named unzipper() which does the work of unzipping the files

Re: determining file type

2006-06-14 Thread Ritesh Raj Sarraf
Also, f = file ('some_file.jpg') throws an error. str object is not callable Ritesh Maric Michaud wrote: Le Mercredi 14 Juin 2006 11:22, Ritesh Raj Sarraf a écrit : Hi, I have a funtion named unzipper() which does the work of unzipping the files. Is there a way I can identify what

zipfile module doesn't allow append

2006-06-29 Thread Ritesh Raj Sarraf
Hi, I've got a problem here. def compress_the_file(zip_file_name, files_to_compress, sSourceDir): Condenses all the files into one single file for easy transfer try: import zipfile except ImportError: sys.stderr.write(Ai! module not found.\n) try:

optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Hi, I'm having some minor problems with optparse. I'm just worried that someone shouldn't say that multiple argument feature isn't implemented in optpartse. How to tackle multiple arguments to an option ? As far as I dug, I've found that 1 arguments are being ignored. parser.add_option(,

Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: Hi, I'm having some minor problems with optparse. I'm just worried that someone shouldn't say that multiple argument feature isn't implemented in optpartse. How to tackle multiple arguments to an option ? As far as I dug, I've found that 1 arguments are being

FIXED: Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: I just noticed that the args variable is holding values b and c. the args variables comes from: (options, args) = parser.parse_args() I guess I only need to figure out now is why args isn't storing argument a also... Ritesh I fixed it, I guess. parser.add_option

Re: FIXED: Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Simon Percivall wrote: It might do you good to read the documentation instead of blindly experimenting. Anyway, parser.add_option(, --my-option, nargs=3) http://docs.python.org/lib/optparse-standard-option-actions.html That won't help because by design of my program, I can't limit the

Re: FIXED: Re: optparse multiple arguments

2006-06-30 Thread Ritesh Raj Sarraf
Fredrik Lundh wrote: Ritesh Raj Sarraf wrote: http://docs.python.org/lib/optparse-standard-option-actions.html That won't help because by design of my program, I can't limit the number of arguments a user can pass to it. do you want options, arguments, or are you just somewhat

compressed file ended before the logical end-of-stream was detected

2006-07-05 Thread Ritesh Raj Sarraf
Hi, The program downloads the files from the internet and compresses them to a single zip archive using compress_the_file(). Upon running syncer() which calls the decompress_the_file(), the first iteration succeeds. But upon second iteration, I get an IOError exception with the message:

python logging module problem

2006-07-13 Thread Ritesh Raj Sarraf
) console.setLevel(logging.INFO) console_formatter = logging.Formatter('%(message)s') console.setFormatter(console_formatter) logger.addHandler(conerr) logger.addHandler(console) logger.info(Ritesh Raj Sarraf.\n) logger.warning(Ricky Raj Sarraf.\n) Hi, When I execute the above code, logger.info()'s messages

Re: python logging module problem

2006-07-13 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: import os, sys, logging logger = logging.getLogger(my_app) I tried this code: import logging, sys # set up logging to file - see previous section for more details logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-07 Thread Ritesh Raj Sarraf
is supported. For multithreaded applications, in PyDev, you'll see all the threads listed. Then you can use each thread and proceed with debugging the code. Learning Eclipse might take some time but that's worth it. HTH, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity

Re: python logging module problem

2006-07-14 Thread Ritesh Raj Sarraf
Vinay Sajip wrote: It's usual to rely on logger levels and to set handler levels for additional refinement of what goes to a particular handler's destination. The problem is that for StreamHandler, logging module logs to sys.stderr. I want to use the logging feature for most of the messages

Re: python logging module problem

2006-07-14 Thread Ritesh Raj Sarraf
Peter Otten wrote: You can achieve the desired behaviour by adding a custom Filter: import sys import logging logger = logging.getLogger(my_app) logger.setLevel(logging.DEBUG) class LevelFilter(logging.Filter): def __init__(self, level): self.level = level def

class instance scope

2006-07-24 Thread Ritesh Raj Sarraf
Hi, I have a class defined in a file called foo.py In bar.py I've imported foo.py In bar.py's main function, I instantiate the class as follows: log = foo.log(x, y, z) Now in main I'm able to use log.view(), log.error() et cetera. But when I call the same method from some functions which are

Re: class instance scope

2006-07-24 Thread Ritesh Raj Sarraf
Steve Holden wrote: Ritesh Raj Sarraf wrote: But when I call the same method from some functions which are in bar.py, it fails giving me the following error: NameError: global name 'log' is not defined Well, that's preumbaly because your log = foo.log(x, y, z) statement

Re: class instance scope

2006-07-24 Thread Ritesh Raj Sarraf
log = foo.log(x, y, z) Resulting line is: log = foo.log(x, y, z) global log Making the instance log global makes it accessible to all the functions. Now I have only one question, Is this a correct way to do it ? Or are there better way ? Ritesh --

Thread Question

2006-07-27 Thread Ritesh Raj Sarraf
Hi, I have some basic doubts about thread. I have a list which has items in it which need to be downloaded from the internet. Let's say list is: list_items[] which has 100 items in it. I have a function download_from_web() which does the work of downloading the items from the web. It does

Re: Thread Question

2006-07-27 Thread Ritesh Raj Sarraf
() counter += 1 i += 1 counter = 0 join_i = i - 3 while counter 3: threads[join_i].join() counter += 1 join_i += 1 Is this correct ? Comments!! Ritesh Duncan Booth wrote: Ritesh Raj Sarraf wrote: I'm

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
finished: for t in thread_pool: requestQueue.put(None) for t in thread_pool: t.join() Thanks a lot for your replies. Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing logic from one person is plagiarism, stealing from many

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
And people, Is there any documentation on Python Threads or Threads in general. It'd be of great help to really understand. Ritesh Ritesh Raj Sarraf on Thursday 27 Jul 2006 16:37 wrote: Is this the correct way of threading applications ? This is the first time I'd be doing threading. So

Re: Thread Question

2006-07-28 Thread Ritesh Raj Sarraf
. Is this all correct ? I also do have a couple of questions more which would be related to locks. But I'd post them once I get done with this part. Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing logic from one person is plagiarism

Re: Thread Question

2006-08-02 Thread Ritesh Raj Sarraf
on Thursday 27 Jul 2006 22:33 wrote: Ritesh Raj Sarraf wrote: [snip] for item in list_items: download_from_web(item) This way, one items is downloaded at a time. I'm planning to implement threads in my application so that multiple items can be downloaded concurrently. I want the thread

Re: Thread Question

2006-08-03 Thread Ritesh Raj Sarraf
Simon Forman wrote: One other question I had, If my user passes the --zip option, download_from_web() internally (when the download is successful) zips the downloaded data to a zip file. Since in case of threading there'll be multiple threads, and say if one of the thread completes 2

Re: Thread Question

2006-08-03 Thread Ritesh Raj Sarraf
Simon Forman wrote: The other threads will just take the next request from the Queue and process it. They won't care what the one thread is doing, downloading, zipping, whatever. As I mentioned in my previous post, the other threads will also have to go through the same zip the file if the

Re: Thread Question

2006-08-04 Thread Ritesh Raj Sarraf
Gerhard Fiedler wrote: Rather than downloading and zipping in the same thread, you could run multiple threads like you're doing that only download files, and one zip-it-all-up thread. After downloading a file, the download threads place a message in a queue that indicates the file they have

Re: Thread Question

2006-08-04 Thread Ritesh Raj Sarraf
Carl Banks wrote: If you have multiple threads trying to access the same ZIP file at the same time, whether or not they use the same ZipFile object, you'll have trouble. You'd have to change download_from_web to protect against simultaneous use. A simple lock should suffice. Create the

Re: Thread Question

2006-08-05 Thread Ritesh Raj Sarraf
: compress_the_file(zip_type_file, sFile, sSourceDir) os.unlink(sFile) finally: ziplock.release() -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention

Re: Thread Question

2006-08-05 Thread Ritesh Raj Sarraf
. Try moving ziplock = threading.Lock() out of the function, so your code might read, in part: ziplock = threading.Lock() def run(request, response, func=copy_first_match): # And so on... Thanks. That did it. :-) Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity

Threads and Progress Bar

2006-09-01 Thread Ritesh Raj Sarraf
that the progress bar gets over-written by the download progress of files from other threads. I believe my change has to go into the progress bar class to make it thread aware. Are they any docs/suggestions on how to implement progress bars along with threads ? Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT

Re: Threads and Progress Bar

2006-09-01 Thread Ritesh Raj Sarraf
, and tell the thread which bar to update. Yes, you're correct. That's what I'm also suspecting. I tried to do some minor changes but couldn't succeed. Request you to, if you reply with code, give a little explanation so that I can understand and learn from it. Thanks, Ritesh -- Ritesh Raj Sarraf

thread lock question

2006-10-11 Thread Ritesh Raj Sarraf
if that's not true. My question is, in a code example like this which is threaded, does the locking mechanism work correctly ? Or are two different locks being acquired ? Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing

Re: thread lock question

2006-10-12 Thread Ritesh Raj Sarraf
of seconds for the zip to complete. During those couple of seconds, if another thread's file (a couple kb) gets downloaded/copied, will it wait for the lock to be released or will it create another lock ? Thanks, Ritesh Dennis Lee Bieber wrote: On Wed, 11 Oct 2006 18:39:32 +0530, Ritesh Raj

screen output problem

2006-11-25 Thread Ritesh Raj Sarraf
Hi, I have, for very long, been trying to find a consistent solution (which could work across major python platforms - Linux, Windows, Mac OS X) for the following problem. I have a function which downloads files from the web. I've made the function threaded. I'm trying to implement a progress

Re: screen output problem

2006-11-28 Thread Ritesh Raj Sarraf
-- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing logic from one person is plagiarism, stealing from many is research. The great are those who achieve the impossible, the petty are those who cannot - rrs pgp4GnEOe0frx.pgp Description: PGP

Re: screen output problem

2006-11-29 Thread Ritesh Raj Sarraf
on a single line. Probably the apt developers also might have run into the same issue and hence settled down with this workaround. Thanks, Ritesh Dennis Lee Bieber wrote: On Tue, 28 Nov 2006 15:15:28 +0530, Ritesh Raj Sarraf [EMAIL PROTECTED] declaimed the following in comp.lang.python

lock problem

2007-03-15 Thread Ritesh Raj Sarraf
somebody please help about where I'm doing any mistake ? Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing logic from one person is plagiarism, stealing from many is research. The great are those who achieve the impossible

Re: lock problem

2007-03-16 Thread Ritesh Raj Sarraf
Gabriel Genellina wrote: En Thu, 15 Mar 2007 18:31:29 -0300, Ritesh Raj Sarraf [EMAIL PROTECTED] escribió: I'm not sure if there's something wrong in the code mentioned above or is it really a lock problem. Try to break the code into smaller pieces to see what is wrong. It's too long

Re: lock problem

2007-03-16 Thread Ritesh Raj Sarraf
to be the same. Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing logic from one person is plagiarism, stealing from many is research. The great are those who achieve the impossible, the petty are those who cannot - rrs -- http

Re: lock problem

2007-03-17 Thread Ritesh Raj Sarraf
-- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity is the mother of invention. Stealing logic from one person is plagiarism, stealing from many is research. The great are those who achieve the impossible, the petty are those who cannot - rrs -- http://mail.python.org/mailman/listinfo

Re: lock problem

2007-03-17 Thread Ritesh Raj Sarraf
is because the output can be huge and useless. Then I do some pattern matching on that file and filter my data and then delete it. If you think I still am missing something important, request you to describe it. Thanks, Ritesh -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com Necessity

[issue6824] help for a module should list supported platforms

2009-09-02 Thread Ritesh Raj Sarraf
New submission from Ritesh Raj Sarraf r...@researchut.com: Whey I do a help (python-module), I get the help text as follows: Help on module tempfile: NAME tempfile - Temporary files. FILE /usr/lib/python2.5/tempfile.py MODULE DOCS http://www.python.org/doc/2.5.4/lib/module

[issue6824] help for a module should list supported platforms

2009-09-02 Thread Ritesh Raj Sarraf
Changes by Ritesh Raj Sarraf r...@researchut.com: -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6824 ___ ___ Python

[issue6824] help for a module should list supported platforms

2009-09-03 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf r...@researchut.com added the comment: Take help os or help os.fork for example. WIth the help output that they provide, how am I supposed to know that os.fork is only supported on Unix. We can also go with the assumption that the modules shipped are cross-platform

[issue6824] help for a module should list supported platforms

2009-09-04 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf r...@researchut.com added the comment: I never said that I think it is not cross-platform. My point is, it should be good to list down a module's dependency in the python help docs. Like: tempfile Supported Platforms: ALL Exception: On Platform foo, feature tempfile.bar

[issue6247] should we include argparse

2009-06-09 Thread Ritesh Raj Sarraf
New submission from Ritesh Raj Sarraf r...@researchut.com: Shoudl argparse be included in the Python Standard Library. I know we already have getopt and optparse but optparse doesn't support many features easily. (like options without hyphen, nargs=*) Here a little about argparse: argparse

[issue6247] should we include argparse

2009-06-09 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf r...@researchut.com added the comment: From the author, Steven Berthard: Sorry about the delay - conferences and moving means that I haven't had as much time for argparse as I'd like. Basically, the way things get into the Python standard library

[issue6247] should we include argparse

2009-06-09 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf r...@researchut.com added the comment: Thanks for the link. As a user, I see many of the features that argparse brings, to be helpful. Since they are missing in optparse, and since it doesn't look like argparse will be included, should I open new bugs for those features

[issue6247] should we include argparse

2009-06-10 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf r...@researchut.com added the comment: I'm not sure about the design part, but as a user, I find both to have very similar interfaces. argparse is better because it handles nargs=*. This has long been asked in optparse. Positional arguments is something I wanted recently