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

Date 2014-09-26 17:45 +0200
From Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: PyCli : Need some reference to good books or tutorials on pycli
Newsgroups comp.lang.python
Message-ID <mailman.14397.1411746319.18130.python-list@python.org> (permalink)

Show all headers | 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