1

I want to create a terminal like design using tkinter. I also want to include terminal like function where once you hit enter, you would not be able to change your previous lines of sentences. Is it even possible to create such UI design using tkinter?

An example of a terminal design may look like this:

1

大陸北方網友
  • 3,696
  • 3
  • 12
  • 37
DJ ShankyShoe
  • 39
  • 1
  • 5

2 Answers2

0

According to my research, i have found an answer and link that may help you out

Firstly i would like you to try this code, this code takes the command "ipconfig" and displays the result in a new window, you can modify this code:-

import tkinter
import os
def get_info(arg):
    x = Tkinter.StringVar()
    x = tfield.get("linestart", "lineend") # gives an error 'bad text index "linestart"'
    print (x)
    
root = tkinter.Tk()
tfield = tkinter.Text(root)
tfield.pack()
for line in os.popen("ipconfig", 'r'):
    tfield.insert("end", line)
tfield.bind("<Return>", get_info)
root.mainloop()

And i have found a similar question on quora take a look at this

Praveen
  • 106
  • 1
  • 11
0

After asking for additional help by breaking down certain parts, I was able to get a solution from j_4321 post. Link: https://stackoverflow.com/a/63830645/11355351

DJ ShankyShoe
  • 39
  • 1
  • 5