0

All the other questions on this forum tell you how to use rust to do something in python, but I want to do the opposite.

I have a function in my main.py script that reads the user's input and stores it. I want to pass that information to a rust file that will then, as a placeholder, print this string. This is my python code:

#creating root window
root = Tk()

#function_definitions
def callback():
    text = textEditor.get(0.1,END)
    return(text)

#defining text editor
textEditor = Text(root, width=43, height=10)
textEditor.pack()

#button 1
button1 = Button(root, text="Display text", command = callback )
button1.pack(pady=12)

I want to use the output of callback() in rust. How do I do this?

Nick M
  • 73
  • 1
  • 8
  • you want to pass how? if it is a file just read the file from rust, you can pipe stdin and stdout of a process from python, or many other options. You need to specify what do you need to do. – Netwave Jan 19 '22 at 15:39
  • 1
    Maybe https://pyo3.rs/latest/python_from_rust.html will provide some pointers? – Mika Vatanen Jan 19 '22 at 16:32

0 Answers0