Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!backfill.erje.net!feeder.erje.net!eu.feeder.erje.net!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'framework.': 0.09; 'params': 0.09; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '(something': 0.16; 'cli': 0.16; 'scripts.': 0.16; 'subject:python': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'thu,': 0.19; 'examples': 0.20; 'example': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'appreciated.': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'figure': 0.32; 'url:python': 0.33; 'framework': 0.33; 'problem': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'executing': 0.36; 'url:listinfo': 0.36; "didn't": 0.36; 'hi,': 0.36; 'url:org': 0.36; 'should': 0.36; 'pm,': 0.38; 'rather': 0.38; "couldn't": 0.39; 'guidance': 0.39; 'url:mail': 0.40; 'how': 0.40; 'commands': 0.60; 'address': 0.63; 'such': 0.63; 'grab': 0.64; 'to:addr:gmail.com': 0.65; 'within': 0.65; 'lack': 0.78; 'forward.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UV6F6a7AwdIH9f+EL8OTAhwdH/c5fRh+Hb4uA3OGetM=; b=SXl6WYG/q8ZkqtfLoHYse7CZBqTTllY60Tl3gKf7jmx8wOFo+xfupZf7AEQBovTvrS EcOCzX+tDatM9u5RI/3GryrlOcjIGenSlCQn0QpHR63Rxwfd5DQBN3KEdtEf8nhdex0l 7E2039kOjcCCfrGX2X/FUtfDPALyF103VHwpcWLqnxme8WlyrR7mn2sBi6Mm77OEC/7u WWVd4dOOi6aDJxGjNY4131la9pv9Bnb6bXASjLckHLrrS54hhVJgO2DrMEJ+dXtGbzdm y5+8DvMCh8ocxAqmLHCqb58Z7fi4CIVJ3KfVDCrfzL84KzDsMFdfnegJYc6/spY1kam7 IfRA== MIME-Version: 1.0 X-Received: by 10.236.143.4 with SMTP id k4mr4456506yhj.183.1412868340259; Thu, 09 Oct 2014 08:25:40 -0700 (PDT) In-Reply-To: <274771d2-4a11-40fe-bc31-ccfaa7d32690@googlegroups.com> References: <274771d2-4a11-40fe-bc31-ccfaa7d32690@googlegroups.com> Date: Thu, 9 Oct 2014 20:55:40 +0530 Subject: Re: CLI framework using python From: Unix SA To: vijnaana@gmail.com Content-Type: multipart/alternative; boundary=20cf303a2fc98921cc0504ff0bd4 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 98 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412868348 news.xs4all.nl 2916 [2001:888:2000:d::a6]:40920 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 6825 X-Received-Body-CRC: 3914045063 Xref: csiph.com comp.lang.python:78896 --20cf303a2fc98921cc0504ff0bd4 Content-Type: text/plain; charset=UTF-8 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 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 eth0 172.16.25.125) > > 2. Within the script i grab the params and do something to the effect of > user executing 'ifconfig eth0 172.16.25.125' from the shell. > > 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 forward. > > 4. The CLI framework needs to reuse code so i didn't want to use pure > python and develop a framework from scratch. Rather use something like > pyCLI/CLIFF. > > The problem is lack of documentation with examples on how to use the above. > > Any guidance would be greatly appreciated. > > Regards & Thanks, > Vij > > -- > https://mail.python.org/mailman/listinfo/python-list > --20cf303a2fc98921cc0504ff0bd4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,

Go for Optparse.. Look at below docs on= how to use it.

http://pym= otw.com/2/optparse/

Regards,
DJ

On Thu, Oct 9, 2014 at 5:50 PM,= <vijnaana@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 params et= h0 and ip address (something like ifconf.py=C2=A0 eth0 172.16.25.125)

2. Within the script i grab the params and do something to the effect of us= er executing 'ifconfig eth0 172.16.25.125' from the shell.

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&= #39;t figure out how to move forward.

4. The CLI framework needs to reuse code so i didn't want to use pure p= ython and develop a framework from scratch. Rather use something like pyCLI= /CLIFF.

The problem is lack of documentation with examples on how to use the above.=

Any guidance would be greatly appreciated.

Regards & Thanks,
Vij

--
https://mail.python.org/mailman/listinfo/python-list

--20cf303a2fc98921cc0504ff0bd4--