Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import time
- janela = Tk()
- janela.geometry("400x400+100+100")
- def salve():
- narquivo = str(e1.get())
- arquivo = open('{}.odt'.format(narquivo),"w")
- aula = str(e2.get())
- arquivo.write("Aula do Dia: "+aula+'\n')
- bt.destroy()
- l.destroy()
- l2.destroy()
- e2.destroy()
- e1.destroy()
- l1 = Label(janela, text="Texto Digitado e Salvo",fg='#008000')
- l1.grid(row=1,column=0)
- text = str(input("Digite seu Texto: "))
- com = int(input("Deseja por mais paragrafos?\nSim-Digite o numero de paragrafos\nNão-Digite 0\n"))
- if com > 0 :
- aux=com
- a= []
- d= []
- arquivo.write("\n"+text+'\n')
- for i in range(aux):
- com=com-1
- d =str(input("Digite o texto: \n"))
- a.append(d)
- arquivo.write('\n'+a[i]+'\n')
- x =False
- while not x:
- print("Finalizado!")
- x= True
- else:
- c = Label(janela,text= text)
- c.grid(row=2,column=0)
- print("Finalizado!")
- l = Label(janela,text="Qual Sera o nome do arquivo?",fg='#008000')
- l.grid(row=0,column=0)
- e1 = Entry(janela)
- e1.grid(row=1 , column=0)
- l2 = Label(janela,text="Voce está em qual aula?",fg='#008000')
- l2.grid(row=2,column=0)
- e2 = Entry(janela)
- e2.grid(row=3,column=0)
- bt = Button(janela, text="ok",command=salve)
- bt.grid(row=4,column=0)
- janela.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement