Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import tkinter
- from tkinter import scrolledtext
- main_window = tkinter.Tk()
- main_window.geometry('1280x720')
- main_window.title('Text Editor 3000')
- def open_file(filename):
- pass
- files = os.listdir('.')
- for i in range(len(files)):
- filename = files[i]
- btn = tkinter.Button(main_window, text=filename,
- font=('Consolas', 14),
- command=lambda: open_file(filename))
- btn.grid(column=0, row=i)
- def create_new(file):
- pass
- def save_file():
- pass
- new_btn = tkinter.Button(main_window, text='Create new file',
- font=('Consolas', 14), command=create_new)
- new_btn.grid(column=1, row=0)
- new_btn = tkinter.Button(main_window, text='Save file',
- font=('Consolas', 14), command=save_file)
- new_btn.grid(column=2, row=0)
- filename = tkinter.Entry(main_window, width=20)
- filename.grid(column=3, row=0)
- txt = scrolledtext.ScrolledText(main_window, width=100, height=30)
- txt.grid(column=1, row=1, columnspan=10, rowspan=10)
- main_window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement