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!
- Host: GitHub
- URL: https://github.com/humansinput/tclconv
- Owner: humansinput
- Created: 2020-03-27T15:39:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T18:17:04.000Z (over 5 years ago)
- Last Synced: 2025-05-07T09:12:03.215Z (25 days ago)
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.asciidoc
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<