Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hieberst/tcl-magic
IPython extension which adds Tcl magics.
https://github.com/hieberst/tcl-magic
ipython python tcl
Last synced: 9 days ago
JSON representation
IPython extension which adds Tcl magics.
- Host: GitHub
- URL: https://github.com/hieberst/tcl-magic
- Owner: hieberst
- License: mit
- Created: 2019-06-29T19:43:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T13:48:43.000Z (over 1 year ago)
- Last Synced: 2024-10-13T03:46:45.551Z (23 days ago)
- Topics: ipython, python, tcl
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tcl magic
[IPython](https://ipython.org) extension which adds [Tcl](https://www.tcl.tk) magics.
The trigger for the development of this IPython extension was the support of a new colleague during his induction, whereby this extension helped as follows:
1. Demonstrate using Tcl from within Python.
2. Allow to use [Jupyter Notebook](https://jupyter.org) as a common environment for a short introduction to both [Python](https://www.python.org) and Tcl.My play instinct to just write a simple IPython extension was of course reason enough.
## Installation
Install or upgrade with `pip`:
pip install -U tcl-magic
## Usage
Load the extension:
In[1]: %load_ext tclmagic
Use the line magic `%tcl` to execute external Tcl code:
In[2]: %tcl pi.tcl
Out[2] 3.141592653589793
Use the cell magic `%%tcl` to execute inline Tcl:
In[3]: %%tcl
set tcl_precision 17
expr acos(-1)Out[3] 3.141592653589793