Skip to main content

Python wrapper for programs that expose a tcl interface

Project description

Python wrapper to interact with TCL command line interfaces. In most cases, tkinter (with the send command) is enough but sometimes it is convenient to interact directly with the tcl cli provided by applications.

Installing Non-Development Version

If you want to just install the tclwrapper package, you should be able to using the following command:

$ pip3 install tclwrapper

Usage

As an example, here is some code that interfaces with GTKWave’s TCL interface:

from tclwrapper import TCLWrapper
with TCLWrapper('gtkwave', '-W') as tcl:
    tcl.eval('gtkwave::loadFile %s' % filename)
    tcl.eval('set num_facs [gtkwave::getNumFacs]')
    signals = tcl.eval('''
        set all_facs [list]
        for {set i 0} {$i < $num_facs} {incr i} {
            lappend all_facs [gtkwave::getFacName $i]
        }
        return $all_facs''', to_list = True)

Installing for Development

To install this package for development, you should use a virtual environment, and install the package in editable mode using pip.

To create a virtual environment for this project, run the command below.

$ python3 -m venv path/to/new-venv-folder

To start using your new virtual environment, run the command below. This needs to be run each time you open a new terminal.

$ source path/to/new-venv-folder/bin/activate

At this point you are now using your new virtual environment. Python packages you install in this environment will not be available outside your virtual environment. If you want to stop using the virtual environment, just run deactivate.

To install the tclwrapper package in editable mode, inside the tclwrapper top git repository folder, run the command below.

$ pip3 install -e .

Project details


Download files

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

Source Distribution

tclwrapper-0.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

tclwrapper-0.0.1-py2-none-any.whl (6.2 kB view details)

Uploaded Python 2

File details

Details for the file tclwrapper-0.0.1.tar.gz.

File metadata

  • Download URL: tclwrapper-0.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for tclwrapper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 79e960e4336b0ffb59147b474fc7eef8f5c94db91897f3195830e35a9e48e603
MD5 ffbfd7c202491aaa66483ecec6f564fc
BLAKE2b-256 c912415ce7843101faccc72e05117e40a1534245774f40d2322a399e77d595cc

See more details on using hashes here.

File details

Details for the file tclwrapper-0.0.1-py2-none-any.whl.

File metadata

  • Download URL: tclwrapper-0.0.1-py2-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for tclwrapper-0.0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 a71150d7854f89dc1557c89c3e2d5950e6fdd69b261c2c1ff2550cdbc8eedd9a
MD5 0b75cba635e920217f85e218631b6079
BLAKE2b-256 8c1cf26f27b7dc478cbd834c6ff1bcfa357cf5bbf68fe518bc3611ab8a0fe177

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page