Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78382

Re: PyCli : Need some reference to good books or tutorials on pycli

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=339ba2612=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.174
X-Spam-Level *
X-Spam-Evidence '*H*': 0.66; '*S*': 0.00; 'friday,': 0.09; 'api': 0.11; 'cc:addr:python-list': 0.11; 'python': 0.11; 'books': 0.15; 'cli': 0.16; 'dev.': 0.16; 'folks,': 0.16; 'subject:books': 0.16; 'subject:tutorials': 0.16; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'source': 0.25; 'subject: : ': 0.26; 'tutorials': 0.26; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'code': 0.31; 'linux.': 0.31; 'skip:i 60': 0.31; 'subject:some': 0.31; '-----': 0.33; 'but': 0.35; 'google': 0.35; "didn't": 0.36; 'material': 0.36; 'should': 0.36; 'email addr:python.org': 0.37; 'thank': 0.38; 'same.': 0.38; 'subject:': 0.39; 'delete': 0.39; 'easy': 0.60; 'commands': 0.60; 'exposure': 0.60; 'you.': 0.62; 'email addr:gmail.com': 0.63; 'information': 0.63; 'received:194': 0.64; 'subject:Need': 0.64; 'more': 0.64; 'email name:python-list': 0.65; 'to:addr:gmail.com': 0.65; 'notice:': 0.67; 'person,': 0.68; 'privileged.': 0.69; 'disclose': 0.74; 'expose': 0.84; 'subject:good': 0.84; 'mean.': 0.91; 'medium.': 0.91
X-IronPort-AV E=Sophos;i="5.04,604,1406584800"; d="scan'208";a="3375576"
Date Fri, 26 Sep 2014 17:45:17 +0200 (CEST)
From Jean-Michel Pichavant <jeanmichel@sequans.com>
To vijnaana@gmail.com
In-Reply-To <48e1bd9f-a2c6-4c97-a971-0653e44a29c0@googlegroups.com>
Subject Re: PyCli : Need some reference to good books or tutorials on pycli
MIME-Version 1.0
X-Mailer Zimbra 7.2.7_GA_2942 (ZimbraWebClient - GC35 (Linux)/7.2.7_GA_2942)
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14397.1411746319.18130.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411746319 news.xs4all.nl 2965 [2001:888:2000:d::a6]:33724
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78382

Show key headers only | View raw


----- Original Message -----
> From: vijnaana@gmail.com
> To: python-list@python.org
> Sent: Friday, 26 September, 2014 2:54:48 PM
> Subject: PyCli : Need some reference to good books or tutorials on pycli
> 
> Hi Folks,
> 
> I need to develop a CLI (PyCli or similar)on Linux.
> To be more specific to develop Quagga(open source routing software)
> like
> commands using python instead of C.
> 
> Need some good reference material for the same.
> 
> P.S google didn't help
> 
> Thank You!
> Vij


Have you considered using ipython ?

I have built a CLI on top of that and it's pretty easy and effective, and it requires almost no dev. The following code is untested but it should give you an idea of what I mean.

cli.py:

import IPython
import yourApi

# explict exposure
foo = yourApi.foo
bar = yourApi.bar

# or you can expose all the content of yourApi
api = yourApi

# delete unwanted names
del yourApi
del IPython

# start the interactive CLI
IPython.frontend.terminal.embed.InteractiveShellEmbed(banner1='Hello Word', exit_msg='bbye')()

Regards,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: PyCli : Need some reference to good books or tutorials on pycli Jean-Michel Pichavant <jeanmichel@sequans.com> - 2014-09-26 17:45 +0200

csiph-web