Sem resumo de edição Etiqueta: visualeditor |
Sem resumo de edição Etiqueta: visualeditor |
||
| Linha 1: | Linha 1: | ||
== Fase 2 - Concluída == | |||
<syntaxhighlight lang="python3"> | |||
from tkinter import ttk | |||
from tkinter import * | |||
from datetime import datetime | |||
from datetime import date | |||
#FUNÇAO PARA CRIAR UM EVENTO; | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
def criar(): | |||
def Adicionar(): | |||
nome = aname.get() | |||
data = adata.get() | |||
preço = apreço.get() | |||
local = alocal.get() | |||
lista = [] | |||
lista.append(nome + ';') | |||
lista.append(data +';') | |||
lista.append(preço + ';') | |||
lista.append(local + ';') | |||
arquivo=open("eventos.txt", "r") | |||
t=arquivo.readlines() | |||
arquivo.close | |||
j = [] | |||
flag = True | |||
for i in t: | |||
j=i.split(';') | |||
if(j[1]==data and j[3]==local): | |||
flag=False | |||
Label(janelacriar, text="JA EXISTE UM EVENTO NESSE LOCAL NESSA DATA", foreground = "red").place(x=10, y=100) | |||
aux = lista[0] + lista[1] + lista[2] + lista[3] | |||
if(flag and len(aux) > 7): | |||
arquivo = open("eventos.txt", "a") | |||
arquivo.writelines(lista) | |||
arquivo.write("\n") | |||
arquivo.close() | |||
tabela.insert("",'end',values=(nome, data, preço, local)) | |||
janelacriar.destroy() | |||
return | |||
janelacriar = Toplevel() | |||
janelacriar.geometry("300x200") | |||
janelacriar.title("Novo evento") | |||
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5) | |||
aname = Entry(janelacriar) | |||
aname.place(x = 120, y = 5) | |||
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30) | |||
adata = Entry(janelacriar) | |||
adata.place(x = 120, y = 30) | |||
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40) | |||
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55) | |||
apreço = Entry(janelacriar) | |||
apreço.place(x = 120, y = 55) | |||
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80) | |||
alocal = Entry(janelacriar) | |||
alocal.place(x = 120, y = 80) | |||
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = Adicionar).place(x = 200, y = 160) | |||
janelacriar.mainloop() | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#FUNÇAO PARA EDITAR | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
def editar(): | |||
x = tabela.selection()[0] | |||
y = tabela.item(x, "values") | |||
def adicionar(): | |||
nome = aname.get() | |||
data = adata.get() | |||
preço = apreço.get() | |||
local = alocal.get() | |||
arquivo = open("eventos.txt", "a") | |||
lista = [] | |||
lista.append(nome + ';') | |||
lista.append(data +';') | |||
lista.append(preço + ';') | |||
lista.append(local + ';') | |||
arquivo.writelines(lista) | |||
arquivo.write("\n") | |||
arquivo.close() | |||
def delete(): | |||
x = tabela.selection()[0] | |||
y = tabela.item(x, "values") | |||
pesquisa = y[0] | |||
arquivo = open("eventos.txt", "r") | |||
produtos = arquivo.readlines() | |||
arquivo.close() | |||
arquivo = open("eventos.txt", "w") | |||
for i in produtos: | |||
lista = i.split(';') | |||
if lista[0] != pesquisa: | |||
arquivo.writelines(i) | |||
arquivo.close() | |||
x = tabela.selection()[0] | |||
tabela.delete(x) | |||
delete() | |||
tabela.insert("",'end',values=(nome, data, preço, local)) | |||
janelacriar.destroy() | |||
return | |||
janelacriar = Toplevel() | |||
janelacriar.geometry("300x200") | |||
janelacriar.title("Novo evento") | |||
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5) | |||
aname = Entry(janelacriar) | |||
aname.place(x = 120, y = 5) | |||
aname.insert(END, y[0]) | |||
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30) | |||
adata = Entry(janelacriar) | |||
adata.place(x = 120, y = 30) | |||
adata.insert(END, y[1]) | |||
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40) | |||
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55) | |||
apreço = Entry(janelacriar) | |||
apreço.place(x = 120, y = 55) | |||
apreço.insert(END,y[2]) | |||
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80) | |||
alocal = Entry(janelacriar) | |||
alocal.place(x = 120, y = 80) | |||
alocal.insert(END, y[3]) | |||
delete | |||
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = adicionar).place(x = 200, y = 160) | |||
janelacriar.mainloop() | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#FUNÇAO PARA PESQUISAR UM EVENTO; | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
def pesquisar(): | |||
def achar(): | |||
j = [] | |||
nome = aname.get() | |||
data = adata.get() | |||
preço = apreço.get() | |||
local = alocal.get() | |||
arquivo = open("eventos.txt", "r") | |||
t = arquivo.readlines() | |||
arquivo.close() | |||
tabelapesquisar.delete(*tabelapesquisar.get_children()) | |||
for i in t: | |||
j = i.split(';') | |||
if(j[0]==nome or nome==''): | |||
if(j[1]==data or data==''): | |||
if(j[2]==preço or preço==''): | |||
if(j[3]==local or local==''): | |||
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3])) | |||
janelapesquisar = Tk() | |||
janelapesquisar.geometry("600x600") | |||
janelapesquisar.title("Pesquisar") | |||
nome = Label(janelapesquisar, text = "Nome do evento:").place(x = 1, y = 430) | |||
aname = Entry(janelapesquisar) | |||
aname.place(x = 100, y = 430) | |||
data = Label(janelapesquisar, text = "Data:").place(x = 1, y = 455) | |||
adata = Entry(janelapesquisar) | |||
adata.place(x = 100, y = 455) | |||
Exemplo = Label(janelapesquisar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40) | |||
local = Label(janelapesquisar, text = "Local:").place(x = 1, y = 480) | |||
alocal = Entry(janelapesquisar) | |||
alocal.place(x = 100, y = 480) | |||
preço = Label(janelapesquisar, text = "R$:").place(x = 1, y = 505) | |||
apreço = Entry(janelapesquisar) | |||
apreço.place(x = 100, y = 505) | |||
tabelapesquisar = ttk.Treeview(janelapesquisar, selectmode = 'browse', show = 'headings', height = 20) | |||
tabelapesquisar.place(x= 0, y = 0) | |||
tabelapesquisar["columns"] = ("1", "2", "3", "4") | |||
tabelapesquisar['show'] = 'headings' | |||
tabelapesquisar.column("1", width=150, anchor='c') | |||
tabelapesquisar.column("2", width=150, anchor='c') | |||
tabelapesquisar.column("3", width=150, anchor='c') | |||
tabelapesquisar.column("4", width=150, anchor='c') | |||
arquivo = open("eventos.txt", "r") | |||
t = arquivo.readlines() | |||
arquivo.close() | |||
for i in t: | |||
j = i.split(';') | |||
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3])) | |||
g = Button(janelapesquisar, text = "Confirmar", font = "Times ", command = achar).place(x = 520, y = 575) | |||
tabelapesquisar.heading("1", text="Nome") | |||
tabelapesquisar.heading("2", text="Data") | |||
tabelapesquisar.heading("3", text="Preço") | |||
tabelapesquisar.heading("4", text="Local") | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#FUNÇAO PARA DELETAR UM EVENTO; | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
def delete(): | |||
x = tabela.selection()[0] | |||
y = tabela.item(x, "values") | |||
pesquisa = y[0] | |||
arquivo = open("eventos.txt", "r") | |||
produtos = arquivo.readlines() | |||
arquivo.close() | |||
arquivo = open("eventos.txt", "w") | |||
for i in produtos: | |||
lista = i.split(';') | |||
if lista[0] != pesquisa: | |||
arquivo.writelines(i) | |||
arquivo.close() | |||
x = tabela.selection()[0] | |||
tabela.delete(x) | |||
janela.mainloop() | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#FUNÇAO PARA ENCONTRAR OS EVENTOS DA SEMANA; | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
def semana(): | |||
inicio = date.today() #Dia de hoje | |||
fim = date.fromordinal(inicio.toordinal()+7) #Ultimo dia da semana: depois de 7 dias | |||
janela1 = Tk() | |||
janela1.title("Eventos da Semana (" + inicio.strftime('%d/%m') + " ate " + fim.strftime('%d/%m') + ")") | |||
janela1.geometry("600x600") | |||
tabela1 = ttk.Treeview(janela1, selectmode = 'browse', show = 'headings', height = 29) | |||
tabela1.place(x= 0, y = 0) | |||
tabela1["columns"] = ("1", "2", "3", "4") | |||
tabela1['show'] = 'headings' | |||
tabela1.column("1", width=150, anchor='c') | |||
tabela1.column("2", width=150, anchor='c') | |||
tabela1.column("3", width=150, anchor='c') | |||
tabela1.column("4", width=150, anchor='c') | |||
tabela1.heading("1", text="Nome") | |||
tabela1.heading("2", text="Data") | |||
tabela1.heading("3", text="Preço") | |||
tabela1.heading("4", text="Local") | |||
arquivo = open("eventos.txt", "r") | |||
tudo = arquivo.readlines() | |||
arquivo.close() | |||
for i in range(0, len(tudo)): | |||
v = tudo[i].split(';') | |||
coisa = v[1].split('/') #vetor com a data:[dia, mes, ano] | |||
if int(coisa[0]) >= inicio.day and int(coisa[0]) <= fim.day: | |||
if int(coisa[1]) >= inicio.month and int(coisa[1]) <= fim.month: | |||
if int(coisa[2]) >= inicio.year and int(coisa[2]) <= fim.year: #se estiver dentro do intervalo | |||
tabela1.insert("",'end',values=(v[0], v[1], v[2], v[3])) | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#JANELA; | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
janela = Tk() | |||
janela.title("Let's Q Let's") | |||
janela.geometry("600x600") | |||
v = [] | |||
arquivo = open("eventos.txt", "a") | |||
arquivo.close() | |||
tabela = ttk.Treeview(janela, selectmode = 'browse', show = 'headings', height = 29) | |||
arquivo = open("eventos.txt", "r") | |||
t = arquivo.readlines() | |||
arquivo.close() | |||
for i in t: | |||
v = i.split(';') | |||
tabela.insert("",'end',text= "L1",values=(v[0], v[1], v[2], v[3])) | |||
#BOTOES | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#BOTAO DE CRIAR | |||
criar = Button(text = "Adicionar evento", command = criar) | |||
criar.place(x = 1, y = 575) | |||
#BOTAO DE PESQUISAR | |||
pesquisar = Button(text = "Pesquisar evento", command = pesquisar) | |||
pesquisar.place(x = 105, y = 575) | |||
#BOTAO DE EDITAR | |||
editar = Button(janela, text = "Editar", command = editar) | |||
editar.place(x = 210, y = 575) | |||
#BOTAO DE DELETAR | |||
delete= Button(janela, text = "Delete", command = delete) | |||
delete.place(x = 556, y = 575) | |||
#BOTAO DE EVENTOS DA SEMANA | |||
semana = Button(janela, text = "eventos da semana", command = semana).place(x = 255, y = 575) | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
#TABELA PRINCIPAL | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
tabela.place(x= 0, y = 0) | |||
tabela["columns"] = ("1", "2", "3", "4") | |||
tabela['show'] = 'headings' | |||
tabela.column("1", width=150, anchor='c') | |||
tabela.column("2", width=150, anchor='c') | |||
tabela.column("3", width=150, anchor='c') | |||
tabela.column("4", width=150, anchor='c') | |||
tabela.heading("1", text="Nome") | |||
tabela.heading("2", text="Data") | |||
tabela.heading("3", text="Preço") | |||
tabela.heading("4", text="Local") | |||
janela.mainloop() | |||
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ | |||
</syntaxhighlight> | |||
== Fase 1 - Concluida == | == Fase 1 - Concluida == | ||
<syntaxhighlight lang="py" line="1"> | <syntaxhighlight lang="py" line="1"> | ||
Edição atual tal como às 13h24min de 18 de julho de 2017
Fase 2 - Concluída
<syntaxhighlight lang="python3"> from tkinter import ttk from tkinter import * from datetime import datetime from datetime import date
#FUNÇAO PARA CRIAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def criar():
def Adicionar():
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
lista = []
lista.append(nome + ';')
lista.append(data +';')
lista.append(preço + ';')
lista.append(local + ';')
arquivo=open("eventos.txt", "r")
t=arquivo.readlines()
arquivo.close
j = []
flag = True
for i in t:
j=i.split(';')
if(j[1]==data and j[3]==local):
flag=False
Label(janelacriar, text="JA EXISTE UM EVENTO NESSE LOCAL NESSA DATA", foreground = "red").place(x=10, y=100)
aux = lista[0] + lista[1] + lista[2] + lista[3]
if(flag and len(aux) > 7):
arquivo = open("eventos.txt", "a")
arquivo.writelines(lista)
arquivo.write("\n")
arquivo.close()
tabela.insert("",'end',values=(nome, data, preço, local))
janelacriar.destroy()
return
janelacriar = Toplevel()
janelacriar.geometry("300x200")
janelacriar.title("Novo evento")
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5)
aname = Entry(janelacriar)
aname.place(x = 120, y = 5)
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30)
adata = Entry(janelacriar)
adata.place(x = 120, y = 30)
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55)
apreço = Entry(janelacriar)
apreço.place(x = 120, y = 55)
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80)
alocal = Entry(janelacriar)
alocal.place(x = 120, y = 80)
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = Adicionar).place(x = 200, y = 160)
janelacriar.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA EDITAR
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def editar():
x = tabela.selection()[0]
y = tabela.item(x, "values")
def adicionar():
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
arquivo = open("eventos.txt", "a")
lista = []
lista.append(nome + ';')
lista.append(data +';')
lista.append(preço + ';')
lista.append(local + ';')
arquivo.writelines(lista)
arquivo.write("\n")
arquivo.close()
def delete():
x = tabela.selection()[0]
y = tabela.item(x, "values")
pesquisa = y[0]
arquivo = open("eventos.txt", "r")
produtos = arquivo.readlines()
arquivo.close()
arquivo = open("eventos.txt", "w")
for i in produtos:
lista = i.split(';')
if lista[0] != pesquisa:
arquivo.writelines(i)
arquivo.close()
x = tabela.selection()[0]
tabela.delete(x)
delete()
tabela.insert("",'end',values=(nome, data, preço, local))
janelacriar.destroy()
return
janelacriar = Toplevel()
janelacriar.geometry("300x200")
janelacriar.title("Novo evento")
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5)
aname = Entry(janelacriar)
aname.place(x = 120, y = 5)
aname.insert(END, y[0])
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30)
adata = Entry(janelacriar)
adata.place(x = 120, y = 30)
adata.insert(END, y[1])
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55)
apreço = Entry(janelacriar)
apreço.place(x = 120, y = 55)
apreço.insert(END,y[2])
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80)
alocal = Entry(janelacriar)
alocal.place(x = 120, y = 80)
alocal.insert(END, y[3])
delete
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = adicionar).place(x = 200, y = 160)
janelacriar.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA PESQUISAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def pesquisar():
def achar():
j = []
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
arquivo = open("eventos.txt", "r")
t = arquivo.readlines()
arquivo.close()
tabelapesquisar.delete(*tabelapesquisar.get_children())
for i in t:
j = i.split(';')
if(j[0]==nome or nome==):
if(j[1]==data or data==):
if(j[2]==preço or preço==):
if(j[3]==local or local==):
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3]))
janelapesquisar = Tk()
janelapesquisar.geometry("600x600")
janelapesquisar.title("Pesquisar")
nome = Label(janelapesquisar, text = "Nome do evento:").place(x = 1, y = 430)
aname = Entry(janelapesquisar)
aname.place(x = 100, y = 430)
data = Label(janelapesquisar, text = "Data:").place(x = 1, y = 455)
adata = Entry(janelapesquisar)
adata.place(x = 100, y = 455)
Exemplo = Label(janelapesquisar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
local = Label(janelapesquisar, text = "Local:").place(x = 1, y = 480)
alocal = Entry(janelapesquisar)
alocal.place(x = 100, y = 480)
preço = Label(janelapesquisar, text = "R$:").place(x = 1, y = 505)
apreço = Entry(janelapesquisar)
apreço.place(x = 100, y = 505)
tabelapesquisar = ttk.Treeview(janelapesquisar, selectmode = 'browse', show = 'headings', height = 20)
tabelapesquisar.place(x= 0, y = 0)
tabelapesquisar["columns"] = ("1", "2", "3", "4")
tabelapesquisar['show'] = 'headings'
tabelapesquisar.column("1", width=150, anchor='c')
tabelapesquisar.column("2", width=150, anchor='c')
tabelapesquisar.column("3", width=150, anchor='c')
tabelapesquisar.column("4", width=150, anchor='c')
arquivo = open("eventos.txt", "r")
t = arquivo.readlines()
arquivo.close()
for i in t:
j = i.split(';')
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3]))
g = Button(janelapesquisar, text = "Confirmar", font = "Times ", command = achar).place(x = 520, y = 575)
tabelapesquisar.heading("1", text="Nome")
tabelapesquisar.heading("2", text="Data")
tabelapesquisar.heading("3", text="Preço")
tabelapesquisar.heading("4", text="Local")
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA DELETAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def delete():
x = tabela.selection()[0]
y = tabela.item(x, "values")
pesquisa = y[0]
arquivo = open("eventos.txt", "r")
produtos = arquivo.readlines()
arquivo.close()
arquivo = open("eventos.txt", "w")
for i in produtos:
lista = i.split(';')
if lista[0] != pesquisa:
arquivo.writelines(i)
arquivo.close()
x = tabela.selection()[0]
tabela.delete(x)
janela.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA ENCONTRAR OS EVENTOS DA SEMANA;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def semana(): inicio = date.today() #Dia de hoje fim = date.fromordinal(inicio.toordinal()+7) #Ultimo dia da semana: depois de 7 dias
janela1 = Tk() janela1.title("Eventos da Semana (" + inicio.strftime('%d/%m') + " ate " + fim.strftime('%d/%m') + ")") janela1.geometry("600x600")
tabela1 = ttk.Treeview(janela1, selectmode = 'browse', show = 'headings', height = 29) tabela1.place(x= 0, y = 0) tabela1["columns"] = ("1", "2", "3", "4") tabela1['show'] = 'headings'
tabela1.column("1", width=150, anchor='c') tabela1.column("2", width=150, anchor='c') tabela1.column("3", width=150, anchor='c') tabela1.column("4", width=150, anchor='c')
tabela1.heading("1", text="Nome") tabela1.heading("2", text="Data") tabela1.heading("3", text="Preço") tabela1.heading("4", text="Local")
arquivo = open("eventos.txt", "r")
tudo = arquivo.readlines()
arquivo.close()
for i in range(0, len(tudo)): v = tudo[i].split(';') coisa = v[1].split('/') #vetor com a data:[dia, mes, ano] if int(coisa[0]) >= inicio.day and int(coisa[0]) <= fim.day: if int(coisa[1]) >= inicio.month and int(coisa[1]) <= fim.month: if int(coisa[2]) >= inicio.year and int(coisa[2]) <= fim.year: #se estiver dentro do intervalo tabela1.insert("",'end',values=(v[0], v[1], v[2], v[3]))
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#JANELA;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
janela = Tk() janela.title("Let's Q Let's") janela.geometry("600x600")
v = [] arquivo = open("eventos.txt", "a") arquivo.close() tabela = ttk.Treeview(janela, selectmode = 'browse', show = 'headings', height = 29) arquivo = open("eventos.txt", "r") t = arquivo.readlines() arquivo.close()
for i in t:
v = i.split(';')
tabela.insert("",'end',text= "L1",values=(v[0], v[1], v[2], v[3]))
#BOTOES
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- BOTAO DE CRIAR
criar = Button(text = "Adicionar evento", command = criar) criar.place(x = 1, y = 575)
- BOTAO DE PESQUISAR
pesquisar = Button(text = "Pesquisar evento", command = pesquisar) pesquisar.place(x = 105, y = 575)
- BOTAO DE EDITAR
editar = Button(janela, text = "Editar", command = editar) editar.place(x = 210, y = 575)
- BOTAO DE DELETAR
delete= Button(janela, text = "Delete", command = delete) delete.place(x = 556, y = 575)
- BOTAO DE EVENTOS DA SEMANA
semana = Button(janela, text = "eventos da semana", command = semana).place(x = 255, y = 575)
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#TABELA PRINCIPAL
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
tabela.place(x= 0, y = 0) tabela["columns"] = ("1", "2", "3", "4") tabela['show'] = 'headings'
tabela.column("1", width=150, anchor='c') tabela.column("2", width=150, anchor='c') tabela.column("3", width=150, anchor='c') tabela.column("4", width=150, anchor='c')
tabela.heading("1", text="Nome") tabela.heading("2", text="Data") tabela.heading("3", text="Preço") tabela.heading("4", text="Local")
janela.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
</syntaxhighlight>
Fase 1 - Concluida
<syntaxhighlight lang="py" line="1">
- 26/06/2017 - 16:26
from tkinter import ttk from tkinter import *
#FUNÇAO PARA CRIAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def criar():
def Adicionar():
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
lista = []
lista.append(nome + ';')
lista.append(data +';')
lista.append(preço + ';')
lista.append(local + ';')
arquivo=open("eventos.txt", "r")
t=arquivo.readlines()
arquivo.close
j = []
flag = True
for i in t:
j=i.split(';')
if(j[1]==data and j[3]==local):
flag=False
Label(janelacriar, text="JA EXISTE UM EVENTO NESSE LOCAL NESSA DATA", foreground = "red").place(x=10, y=100)
aux = lista[0] + lista[1] + lista[2] + lista[3]
if(flag and len(aux) > 7):
arquivo = open("eventos.txt", "a")
arquivo.writelines(lista)
arquivo.write("\n")
arquivo.close()
tabela.insert("",'end',values=(nome, data, preço, local))
janelacriar.destroy()
return
janelacriar = Toplevel()
janelacriar.geometry("300x200")
janelacriar.title("Novo evento")
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5)
aname = Entry(janelacriar)
aname.place(x = 120, y = 5)
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30)
adata = Entry(janelacriar)
adata.place(x = 120, y = 30)
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55)
apreço = Entry(janelacriar)
apreço.place(x = 120, y = 55)
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80)
alocal = Entry(janelacriar)
alocal.place(x = 120, y = 80)
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = Adicionar).place(x = 200, y = 160)
janelacriar.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA EDITAR
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def editar():
x = tabela.selection()[0]
y = tabela.item(x, "values")
def adicionar():
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
arquivo = open("eventos.txt", "a")
lista = []
lista.append(nome + ';')
lista.append(data +';')
lista.append(preço + ';')
lista.append(local + ';')
arquivo.writelines(lista)
arquivo.write("\n")
arquivo.close()
def delete():
x = tabela.selection()[0]
y = tabela.item(x, "values")
pesquisa = y[0]
arquivo = open("eventos.txt", "r")
produtos = arquivo.readlines()
arquivo.close()
arquivo = open("eventos.txt", "w")
for i in produtos:
lista = i.split(';')
if lista[0] != pesquisa:
arquivo.writelines(i)
arquivo.close()
x = tabela.selection()[0]
tabela.delete(x)
delete()
tabela.insert("",'end',values=(nome, data, preço, local))
janelacriar.destroy()
return
janelacriar = Toplevel()
janelacriar.geometry("300x200")
janelacriar.title("Novo evento")
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5)
aname = Entry(janelacriar)
aname.place(x = 120, y = 5)
aname.insert(END, y[0])
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30)
adata = Entry(janelacriar)
adata.place(x = 120, y = 30)
adata.insert(END, y[1])
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55)
apreço = Entry(janelacriar)
apreço.place(x = 120, y = 55)
apreço.insert(END,y[2])
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80)
alocal = Entry(janelacriar)
alocal.place(x = 120, y = 80)
alocal.insert(END, y[3])
delete
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = adicionar).place(x = 200, y = 160)
janelacriar.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA PESQUISAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def pesquisar():
def achar():
j = []
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
arquivo = open("eventos.txt", "r")
t = arquivo.readlines()
arquivo.close()
tabelapesquisar.delete(*tabelapesquisar.get_children())
for i in t:
j = i.split(';')
if(j[0]==nome or nome==):
if(j[1]==data or data==):
if(j[2]==preço or preço==):
if(j[3]==local or local==):
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3]))
janelapesquisar = Tk()
janelapesquisar.geometry("600x600")
janelapesquisar.title("Pesquisar")
nome = Label(janelapesquisar, text = "Nome do evento:").place(x = 1, y = 430)
aname = Entry(janelapesquisar)
aname.place(x = 100, y = 430)
data = Label(janelapesquisar, text = "Data:").place(x = 1, y = 455)
adata = Entry(janelapesquisar)
adata.place(x = 100, y = 455)
Exemplo = Label(janelapesquisar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
local = Label(janelapesquisar, text = "Local:").place(x = 1, y = 480)
alocal = Entry(janelapesquisar)
alocal.place(x = 100, y = 480)
preço = Label(janelapesquisar, text = "R$:").place(x = 1, y = 505)
apreço = Entry(janelapesquisar)
apreço.place(x = 100, y = 505)
tabelapesquisar = ttk.Treeview(janelapesquisar, selectmode = 'browse', show = 'headings', height = 20)
tabelapesquisar.place(x= 0, y = 0)
tabelapesquisar["columns"] = ("1", "2", "3", "4")
tabelapesquisar['show'] = 'headings'
tabelapesquisar.column("1", width=150, anchor='c')
tabelapesquisar.column("2", width=150, anchor='c')
tabelapesquisar.column("3", width=150, anchor='c')
tabelapesquisar.column("4", width=150, anchor='c')
arquivo = open("eventos.txt", "r")
t = arquivo.readlines()
arquivo.close()
for i in t:
j = i.split(';')
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3]))
g = Button(janelapesquisar, text = "Confirmar", font = "Times ", command = achar).place(x = 520, y = 575)
tabelapesquisar.heading("1", text="Nome")
tabelapesquisar.heading("2", text="Data")
tabelapesquisar.heading("3", text="Preço")
tabelapesquisar.heading("4", text="Local")
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA DELETAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def delete():
x = tabela.selection()[0]
y = tabela.item(x, "values")
pesquisa = y[0]
arquivo = open("eventos.txt", "r")
produtos = arquivo.readlines()
arquivo.close()
arquivo = open("eventos.txt", "w")
for i in produtos:
lista = i.split(';')
if lista[0] != pesquisa:
arquivo.writelines(i)
arquivo.close()
x = tabela.selection()[0]
tabela.delete(x)
janela.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#JANELA;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
janela = Tk() janela.title("Let's Q Let's") janela.geometry("600x600")
v = [] arquivo = open("eventos.txt", "a") arquivo.close() tabela = ttk.Treeview(janela, selectmode = 'browse', show = 'headings', height = 29) arquivo = open("eventos.txt", "r") t = arquivo.readlines() arquivo.close()
for i in t:
v = i.split(';')
tabela.insert("",'end',text= "L1",values=(v[0], v[1], v[2], v[3]))
#BOTOES
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- BOTAO DE CRIAR
criar = Button(text = "Adicionar evento", command = criar) criar.place(x = 1, y = 575)
- BOTAO DE PESQUISAR
pesquisar = Button(text = "Pesquisar evento", command = pesquisar) pesquisar.place(x = 105, y = 575)
- BOTAO DE EDITAR
editar = Button(janela, text = "Editar", command = editar) editar.place(x = 210, y = 575)
- BOTAO DE DELETAR
delete= Button(janela, text = "Delete", command = delete) delete.place(x = 556, y = 575)
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#TABELA PRINCIPAL
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
tabela.place(x= 0, y = 0) tabela["columns"] = ("1", "2", "3", "4") tabela['show'] = 'headings'
tabela.column("1", width=150, anchor='c') tabela.column("2", width=150, anchor='c') tabela.column("3", width=150, anchor='c') tabela.column("4", width=150, anchor='c')
tabela.heading("1", text="Nome") tabela.heading("2", text="Data") tabela.heading("3", text="Preço") tabela.heading("4", text="Local")
janela.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
</syntaxhighlight>
21/06/2017 - 11h05
<syntaxhighlight lang="py" line="1"> from tkinter import ttk from tkinter import *
#FUNÇAO PARA CRIAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def criar():
def Adicionar():
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
lista = []
lista.append(nome + ';')
lista.append(data +';')
lista.append(preço + ';')
lista.append(local + ';')
arquivo=open("eventos.txt", "r")
t=arquivo.readlines()
arquivo.close
j = []
flag = True
for i in t:
j=i.split(';')
if(j[1]==data and j[3]==local):
flag=False
Label(janelacriar, text="JA EXISTE UM EVENTO NESSE LOCAL NESSA DATA", foreground = "red").place(x=10, y=100)
if(flag):
arquivo = open("eventos.txt", "a")
arquivo.writelines(lista)
arquivo.write("\n")
arquivo.close()
tabela.insert("",'end',values=(nome, data, preço, local))
janelacriar.destroy()
return
janelacriar = Toplevel()
janelacriar.geometry("300x200")
janelacriar.title("Novo evento")
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5)
aname = Entry(janelacriar)
aname.place(x = 120, y = 5)
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30)
adata = Entry(janelacriar)
adata.place(x = 120, y = 30)
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55)
apreço = Entry(janelacriar)
apreço.place(x = 120, y = 55)
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80)
alocal = Entry(janelacriar)
alocal.place(x = 120, y = 80)
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = Adicionar).place(x = 200, y = 160)
janelacriar.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA EDITAR
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def editar():
x = tabela.selection()[0]
y = tabela.item(x, "values")
def adicionar():
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
arquivo = open("eventos.txt", "a")
lista = []
lista.append(nome + ';')
lista.append(data +';')
lista.append(preço + ';')
lista.append(local + ';')
arquivo.writelines(lista)
arquivo.write("\n")
arquivo.close()
def delete():
x = tabela.selection()[0]
y = tabela.item(x, "values")
pesquisa = y[0]
arquivo = open("eventos.txt", "r")
produtos = arquivo.readlines()
arquivo.close()
arquivo = open("eventos.txt", "w")
for i in produtos:
lista = i.split(';')
if lista[0] != pesquisa:
arquivo.writelines(i)
arquivo.close()
x = tabela.selection()[0]
tabela.delete(x)
delete()
tabela.insert("",'end',values=(nome, data, preço, local))
janelacriar.destroy()
return
janelacriar = Toplevel()
janelacriar.geometry("300x200")
janelacriar.title("Novo evento")
nome = Label(janelacriar, text = "Nome do evento:").place(x = 5, y = 5)
aname = Entry(janelacriar)
aname.place(x = 120, y = 5)
aname.insert(END, y[0])
data = Label(janelacriar, text = "Data:").place(x = 5, y = 30)
adata = Entry(janelacriar)
adata.place(x = 120, y = 30)
adata.insert(END, y[1])
Exemplo = Label(janelacriar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
preço = Label(janelacriar, text = "R$:").place(x = 5, y = 55)
apreço = Entry(janelacriar)
apreço.place(x = 120, y = 55)
apreço.insert(END,y[2])
local = Label(janelacriar, text = "Local:").place(x = 5, y = 80)
alocal = Entry(janelacriar)
alocal.place(x = 120, y = 80)
alocal.insert(END, y[3])
delete
btnadd = Button(janelacriar, text = "Confirmar", font = "Times ", command = adicionar).place(x = 200, y = 160)
janelacriar.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA PESQUISAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def pesquisar():
def achar():
j = []
nome = aname.get()
data = adata.get()
preço = apreço.get()
local = alocal.get()
arquivo = open("eventos.txt", "r")
t = arquivo.readlines()
arquivo.close()
tabelapesquisar.delete(*tabelapesquisar.get_children())
for i in t:
j = i.split(';')
if(j[0]==nome or nome==):
if(j[1]==data or data==):
if(j[2]==preço or preço==):
if(j[3]==local or local==):
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3]))
janelapesquisar = Tk()
janelapesquisar.geometry("600x600")
janelapesquisar.title("Pesquisar")
nome = Label(janelapesquisar, text = "Nome do evento:").place(x = 1, y = 430)
aname = Entry(janelapesquisar)
aname.place(x = 100, y = 430)
data = Label(janelapesquisar, text = "Data:").place(x = 1, y = 455)
adata = Entry(janelapesquisar)
adata.place(x = 100, y = 455)
Exemplo = Label(janelapesquisar, text = "DD/MM/AAAA", font = "Times 5").place(x = 245, y = 40)
local = Label(janelapesquisar, text = "Local:").place(x = 1, y = 480)
alocal = Entry(janelapesquisar)
alocal.place(x = 100, y = 480)
preço = Label(janelapesquisar, text = "R$:").place(x = 1, y = 505)
apreço = Entry(janelapesquisar)
apreço.place(x = 100, y = 505)
tabelapesquisar = ttk.Treeview(janelapesquisar, selectmode = 'browse', show = 'headings', height = 20)
tabelapesquisar.place(x= 0, y = 0)
tabelapesquisar["columns"] = ("1", "2", "3", "4")
tabelapesquisar['show'] = 'headings'
tabelapesquisar.column("1", width=150, anchor='c')
tabelapesquisar.column("2", width=150, anchor='c')
tabelapesquisar.column("3", width=150, anchor='c')
tabelapesquisar.column("4", width=150, anchor='c')
arquivo = open("eventos.txt", "r")
t = arquivo.readlines()
arquivo.close()
for i in t:
j = i.split(';')
tabelapesquisar.insert("",'end',values=(j[0], j[1], j[2], j[3]))
g = Button(janelapesquisar, text = "Confirmar", font = "Times ", command = achar).place(x = 556, y = 575)
tabelapesquisar.heading("1", text="Nome")
tabelapesquisar.heading("2", text="Data")
tabelapesquisar.heading("3", text="Preço")
tabelapesquisar.heading("4", text="Local")
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#FUNÇAO PARA DELETAR UM EVENTO;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
def delete():
x = tabela.selection()[0]
y = tabela.item(x, "values")
pesquisa = y[0]
arquivo = open("eventos.txt", "r")
produtos = arquivo.readlines()
arquivo.close()
arquivo = open("eventos.txt", "w")
for i in produtos:
lista = i.split(';')
if lista[0] != pesquisa:
arquivo.writelines(i)
arquivo.close()
x = tabela.selection()[0]
tabela.delete(x)
janela.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#JANELA;
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
janela = Tk() janela.title("Let's Q Let's") janela.geometry("600x600")
v = [] arquivo = open("eventos.txt", "a") arquivo.close() tabela = ttk.Treeview(janela, selectmode = 'browse', show = 'headings', height = 29) arquivo = open("eventos.txt", "r") t = arquivo.readlines() arquivo.close()
for i in t:
v = i.split(';')
tabela.insert("",'end',text= "L1",values=(v[0], v[1], v[2], v[3]))
#BOTOES
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- BOTAO DE CRIAR
criar = Button(text = "Adicionar evento", command = criar) criar.place(x = 1, y = 575)
- BOTAO DE PESQUISAR
pesquisar = Button(text = "Pesquisar evento", command = pesquisar) pesquisar.place(x = 105, y = 575)
- BOTAO DE EDITAR
editar = Button(janela, text = "Editar", command = editar) editar.place(x = 210, y = 575)
- BOTAO DE DELETAR
delete= Button(janela, text = "Delete", command = delete) delete.place(x = 556, y = 575)
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#TABELA PRINCIPAL
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
tabela.place(x= 0, y = 0) tabela["columns"] = ("1", "2", "3", "4") tabela['show'] = 'headings'
tabela.column("1", width=150, anchor='c') tabela.column("2", width=150, anchor='c') tabela.column("3", width=150, anchor='c') tabela.column("4", width=150, anchor='c')
tabela.heading("1", text="Nome") tabela.heading("2", text="Data") tabela.heading("3", text="Preço") tabela.heading("4", text="Local")
janela.mainloop()
- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
</syntaxhighlight>