Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Tools for interacting with the shell

Project Description

Contents

CgkShell is a set of libraries for interacting with the shell. Currently it consists the following classes:

PersistentBash:

Opens a persistent Bash shell that allows running commands in sequence without losing the effects of the previous commands. E.g. you can issue a command that sets up some environment variables once, and then give control back to your Python application, allowing it to occasionally issue commands to this open shell.

Example usage:

(cgklibs)[14:32] nighty@saltmine CgkShell$ ipython --no-banner
WARNING: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.

In [1]: from cgkshell import PersistentBash

In [2]: with PersistentBash.PersistentBash() as shell:
   ...:     shell.execute("export parrot='a stiff, bereft of life, it rests in peace'")
   ...:     import datetime
   ...:     print(datetime.datetime.today().year)
   ...:     out = shell.execute('export|grep parr')
   ...:     print('-----')
   ...:     print out
   ...:
2016
-----
declare -x parrot="a stiff, bereft of life, it rests in peace"


In [3]: exit
(cgklibs)[14:34] nighty@saltmine CgkShell$

Installation

python setup.py clean build install

Licence

CgkShell is Copyright (c) 2016 Cegeka NV and released under the MIT license. See LICENSE.txt for details.

Contribute

Release History

Release History

This version
History Node

0.0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
CgkShell-0.0.1.0.tar.gz (3.0 kB) Copy SHA256 Checksum SHA256 Source Feb 14, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting