May-26-2018, 10:12 PM
(May-25-2018, 07:57 PM)woooee Wrote: Note that you have to have read permission on fstab (Code not tested so post back if there are errors that you can not fix) Pmw has a ScrolledFrame if you want to install it https://pypi.org/project/Pmw/
Thank you so much for your answer. I tried to use your code by editing my file this way
from tkinter import * #window mywin=Tk() #function about to close window def close_window (root): root.destroy() #function about to read fstab def fstab(): records=open("/etc/fstab", "r").readlines() listbox = Listbox(mywin, height=6, width=20, font=('Fixed', 14), foreground='blue' ) scrolly = Scrollbar(mywin, command=listbox.yview ) listbox.configure(yscrollcommand=scrolly.set) for item in records: listbox.insert("end", item) scrolly.pack(side="right", fill="y") #size window mywin.geometry("600x400+600+100") mywin.title('WINDOW') #text in window mytext=Label(text='View', fg='white', bg='black', font=('Helvetica',30)).pack() #button GO! gobutton=Button(text='GO!', command = fstab).pack() #button Exit exitbutton=Button (mywin, text="Exit", command = lambda: close_window(mywin)).pack() #go mainloop mywin.mainloop()as you suggested, I installed pwm.
on the screen appear the vertical scroll bar, but without, unfortunately, return, no code in the new output.