This is the code from my blog post “Speeding up Python programs with Rust: a practical example”.
ttst.py
the original ttst script, copied from this committtst_blaze.py
the new script as described in the blog post, differs only in thecogitate()
functionchooser/
Rust code
The original ttst.py
is ready to use, refer to python ttst.py --help
and its documentation for more information.
To run the updated ttst_blaze.py
you must first compile the Rust library:
$ cd chooser
$ cargo build --release
$ mv target/release/libchooser.so ../chooser.so