CLI framework using python

2014-10-09 Thread vijnaana
Hi, I need to develop a python CLI framework. For example if i need to set an ip address in linux: ifconfig eth0 172.16.25.125 I should be able to use python to do the above. 1. The user will execute a python script to which i will pass the params eth0 and ip address (something like ifconf.py

Re: CLI framework using python

2014-10-09 Thread Unix SA
Hello, Go for Optparse.. Look at below docs on how to use it. http://pymotw.com/2/optparse/ Regards, DJ On Thu, Oct 9, 2014 at 5:50 PM, wrote: > Hi, > > I need to develop a python CLI framework. > > For example if i need to set an ip address in linux: > > ifconfig eth0 172.16.25.125 > > I sho

Re: CLI framework using python

2014-10-09 Thread Gelonida N
On 10/09/2014 05:25 PM, Unix SA wrote: Hello, Go for Optparse.. Look at below docs on how to use it. http://pymotw.com/2/optparse/ For newer projects I'd suggest argparse (part of Python since 2.7 and can be downloaded / installed for 2.5 / 2.6). https://docs.python.org/2.7/library/argpar

Re: CLI framework using python

2014-10-09 Thread Python UL
On 09-10-14 14:20, vijna...@gmail.com wrote: Hi, I need to develop a python CLI framework. For example if i need to set an ip address in linux: ifconfig eth0 172.16.25.125 I should be able to use python to do the above. 1. The user will execute a python script to which i will pass the param

Re: CLI framework using python

2014-10-10 Thread Rustom Mody
On Thursday, October 9, 2014 9:31:39 PM UTC+5:30, gelonida wrote: > For calling commands in a slightly nicer way than os.system / > sybprocess.Popen you might look at sh or plumbum > https://pypi.python.org/pypi/sh > https://pypi.python.org/pypi/plumbum Both of these look quite nice! [Im looki

Re: CLI framework using python

2014-10-10 Thread Jean-Michel Pichavant
- Original Message - > From: vijna...@gmail.com > > Hi, > > I need to develop a python CLI framework. > [snip] > 3. There are other such commands for which i will be using python > scripts. I came across pyCLI, but it doesn't have much > documentation, so couldn't figure out how to move

Re: CLI framework using python

2014-10-10 Thread Gelonida N
On 10/10/2014 10:43 AM, Rustom Mody wrote: On Thursday, October 9, 2014 9:31:39 PM UTC+5:30, gelonida wrote: For calling commands in a slightly nicer way than os.system / sybprocess.Popen you might look at sh or plumbum https://pypi.python.org/pypi/sh https://pypi.python.org/pypi/plumbum

Re: CLI framework using python

2014-10-14 Thread vijnaana bhairava
Hi Folks, The requirement is to develop a CLI framework in python for a linux router. The suggestions i got is to use PyCli/Cliff. Not sure which would be the right choice! Also, a few APIs are mentioned here: https://pythonhosted.org/pyCLI/#module-cli.app Since i couldn't find any actual imp

Re: CLI framework using python

2014-10-14 Thread Chris Angelico
On Wed, Oct 15, 2014 at 12:33 AM, vijnaana bhairava wrote: > Another question i have is whether it uses argparse? > If so, what value add does PYCLI do? It depends what you mean by "CLI framework". If you simply mean something like hg, where you have subcommands and options and so on, all you rea

Re: CLI framework using python

2014-10-14 Thread Naoki INADA
Click_ is another CLI framework. It support multi-level nested command like git and it has some nice utilities. I love it's design. .. _click: http://click.pocoo.org/3/ — Sent from Mailbox On Tue, Oct 14, 2014 at 10:35 PM, vijnaana bhairava wrote: > Hi Folks, > The requirement is to

Re: CLI framework using python

2014-10-15 Thread vijnaana bhairava
Hi Naoki, I am new to python programming. Getting used to writing basic scripts to understand python. To understand 'Click' i may need some more guidance. For e.g if i were to do 'ifconfig -a' from Click, how would the program look like. That will help me get started. What i am looking for is