From the course: Using Rust with Python

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Embedded Rust CLI diagram

Embedded Rust CLI diagram - Rust Tutorial

From the course: Using Rust with Python

Embedded Rust CLI diagram

- [Instructor] Here we have a PyO3 embedded Python CLI tool here that uses Rust as the main framework to invoke Python, and you can see here that I have an embedded Python function that takes an input, a very simple input that if the string matches marco, it returns back python. If it doesn't, it returns back no python. So it's pretty simple bit of code here, but it's wrapped up with PyO3. So that part is in some ways the straightforward part, but the next question that many people that are working in production environments may want to think about is, what are the next steps that make this a real-world production tool? So the next step, in my opinion, for most interfaces is to start with a command line interface, and with the Rust language, there are many excellent command line tool frameworks. In fact, they allow you to do very sophisticated things like binary deploy, which is one of my favorite ways to deploy a CLI, since you don't have to tell anybody about how to package the…

Contents