Re: [Tutor] Argparse functions with N parameters

2013-06-06 Thread Danilo Chilene
Hello, It's ok to revive a old thread? :) I finished my script (https://github.com/bicofino/Pyora) using argparse. But I have a question, today I'm connecting to the database outside the class Check, what's the best way to connect passing the arguments using argparse and run a function. Today i

Re: [Tutor] Argparse functions with N parameters

2013-05-08 Thread Danilo Chilene
That solves my issue. Thanks Peter. To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/

Re: [Tutor] Argparse functions with N parameters

2013-05-07 Thread Mark Lawrence
On 07/05/2013 17:15, Prasad, Ramit wrote: Peter Otten wrote: [snip] There may be a library out there that does this with bells and whistles, but I haven't looked. This is not related to the OP, but have you [Peter/tutors] taken a look at the docopt library? Any thoughts compared to argparse/

Re: [Tutor] Argparse functions with N parameters

2013-05-07 Thread Prasad, Ramit
Peter Otten wrote: [snip] > > There may be a library out there that does this with bells and whistles, but > I haven't looked. > This is not related to the OP, but have you [Peter/tutors] taken a look at the docopt library? Any thoughts compared to argparse/optparse? ~Ramit This email is con

Re: [Tutor] Argparse functions with N parameters

2013-05-07 Thread Peter Otten
Danilo Chilene wrote: > Hello, > > I have the code below: > > import argparse > class Myclass(object): > > def foo(self): > print 'foo' > > def bar(self): > print 'bar' > > def test(self,name,place): > print name, place > > class Main(Myclass): > def _

[Tutor] Argparse functions with N parameters

2013-05-07 Thread Danilo Chilene
Hello, I have the code below: import argparse class Myclass(object): def foo(self): print 'foo' def bar(self): print 'bar' def test(self,name,place): print name, place class Main(Myclass): def __init__(self): foo_parser = argparse.ArgumentParser