An open API service indexing awesome lists of open source software.

https://github.com/humansinput/tclconv

Create Python/Ruby bindings from Tcl code pretty easily!
https://github.com/humansinput/tclconv

Last synced: 16 days ago
JSON representation

Create Python/Ruby bindings from Tcl code pretty easily!

Awesome Lists containing this project

README

        

== TclConv
Automatically creates Python/Ruby bindings to Tcl code.

=== Example
Suppose you have ``hello.tcl``:

[source,tcl]
----
proc greet {name} {
return "Hello there, $name!"
}
----

When you run:

[source,bash]
----
tclsh tclconv.tcl python hello.tcl > hello_bindings.py
----

You will get compatible Python bindings for ``hello.tcl``. There will be a function called ``greet`` which will take one argument and will return a string.

The resulting functions can be used just like any normal Python functions:

[source,python]
----
print(greet('Tim'))
----

_Don't forget to include hello_bindings.py first_

Output:
[source]
----
Hello there, Tim!
----

Same goes for Ruby:

[source,bash]
----
tclsh tclconv.tcl ruby hello.tcl > hello_bindings.rb
cat >>hellothere.rb<