Hi
Do you mean like when you do this?
+ tell me a poem
- There once was a man named Tim,\n
^ who never quite learned how to swim.\n
^ He fell off a dock, and sank like a rock,\n
^ and that was the end of him.
When you get the reply from that, those “\n” sequences would come back as actual “\n” ASCII newline characters—so if you printed them to your terminal, for example, it would come in with line breaks.
If that’s all working, then your question may be Tkinter specific. What kind of widget are you writing the reply into? For example I’m not sure if a Label widget supports line breaks, but a Text widget does.
Also, in RiveScript, if you don’t want to have to remember to type “\n” everywhere you can set a local parser flag in each RiveScript source file. The flag is file-scoped so each file would need it near the top, or whenever you want it to change how the ^Continue command joins lines together.
! local concat = newline
// equivalent to the above example. each ^Continue
// implicitly joins with a \n
+ tell me a poem
- There once was a man named Tim,
^ who never quite learned how to swim.
^ He fell off a dock, and sank like a rock,
^ and that was the end of him.
// other options
! local concat = none // the default, just joins the lines with no separator
! local concat = space // joins with a space character
// RiveScript code that follows `! local concat` uses the last
// rule set, so you can toggle the option around in the same
// source file.
+ what is my name
- Your name is
^ <get name>, right?
// "Your name is kirsle, right?" -- joins with spaces
I haven’t worked with Tk in Python much, but I found some neat things and wrote my own scrollbar widget if any of this is helpful: https://www.kirsle.net/python-tk-experiments