Created
January 30, 2019 18:11
-
-
Save igorzakhar/2152dae55ceeefd0976a4b0ea77b3963 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from openpyxl import load_workbook | |
root = Tk() | |
root.title('Врачебная программа (alfa)') | |
root.geometry("350x200") | |
entry_name_1 = Entry(width=26, bd=5) | |
entry_name_1.place(x=70, y=10) | |
label_name_1 = Label(width=7, bd=5, text="Entry_1") | |
label_name_1.place(x=5, y=10) | |
entry_name_2 = Entry(width=26, bd=5) | |
entry_name_2.place(x=70, y=45) | |
label_name_2 = Label(width=7, bd=5, text="Entry_2") | |
label_name_2.place(x=5, y=45) | |
def process_xlsx(): | |
workbook = load_workbook('template.xlsx') | |
worksheet = workbook['Лист1'] | |
worksheet['B3'] = entry_name_1.get() | |
worksheet['C5'] = entry_name_2.get() | |
workbook.save('result.xlsx') | |
btn1 = Button(text='Сформировать документ', command=process_xlsx) | |
btn1.place(x=40, y=100) | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment