Feel me, as I'm pretty new to programming. My main question is this. I have a program written in Haskell whose stdout I want to connect to the stdin of a Python program (which will manage GUI-related stuff). Similarly, I want to associate the stdout of a Python program with the stdin of a Haskell program so that it can send information about what the user pressed / typed in the Haskell program.
The first question is that if I set up a pipeline between them, assuming that the stdout of the Python program is connected to the Haskell program, if I use Tkinter to create widgets, etc., will they still be displayed on the screen?
The second question: how exactly can I install this conveyor? Consider the following code example.
main :: IO ()
main = do
string <- getLine
putStrLn $ 5 + read string::Int
Python code will look something like this.
from Tkinter import *
root = Tk()
label = Label(root, text = "Enter a number.")
label.pack()
enternum = Entry(root)
enternum.pack()
enternum.bind("<Return>", print_num)
-- print_num would essentially be a function to send the Haskell program the number
-- which would be received by the getLine function the way I have it.
I apologize if this has already been asked before, but thanks for helping me!
user2180027
source
share