Home > other >  Why turn bosses TAB text box unable to display the data
Why turn bosses TAB text box unable to display the data

Time:12-05

Most of the GUI is normal, but want to display in tabs, I pressed the button but no response, ask for help
(in science fiction, for example, a total of eight tag, don't know you the problem of background)

The from tkinter import *
The from PIL import Image, ImageTk
The import pandas as pd
The from pandas import DataFrame
The from pandas import Series
The import numpy as np
The import matplotlib
The import matplotlib. Pyplot as PLT
PLT. RcParams [' font. Sans-serif]=[' KaiTi]

Biaoge=pd. Read_excel (' big homework. XLSX ', 'Sheet1)

Def kehuan () :
Kehuan1=biaoge [biaoge [' type ']=='science fiction']
Kehuan=kehuan1 [' name ']
Entry. The delete (0, END)
Entry. The insert (0, kehuan)

Def create1 () :
Top1=Toplevel ()
Top1. Title (' top 100 tags ratio)
Top1. Geometry (' 400 x300 ')
Canvas=canvas (top1, width=400, height=300, bd=0, highlightthickness=0)
Imgpath='bintu. GIF'
Img=Image. Open (imgpath)
Photo=ImageTk. PhotoImage (img)
Canvas. Create_image (200150, image=photo)
Canvas. The grid ()
Top1. Mainloop ()


Def create2 () :
Top=Toplevel ()
Top. Title (' Bangumi cartoon label ')
Top. Geometry (' 400 x500 ')
Canvas=canvas (top, width=400, height=500, bd=0, highlightthickness=0)
Imgpath='bj. GIF'
Img=Image. Open (imgpath)
Photo=ImageTk. PhotoImage (img)
Canvas. Create_image (0, 0, image=photo)
Canvas. The grid ()

Entry=entry (top, highlightthickness=2)
Entry. The grid ()
Canvas. Create_window (200, 300, width=200, height=300, window=entry)

The count=0
L1=[' science ', 'cure', 'blood' and 'youth', 'light novels',' fantasy ', 'funny', 'childhood']
L2=[' kehuan ', 'zhiyu', 'rexue', 'qinchun', 'qingxiaoshuo', 'qihuan', 'gaoxiao', 'tongnian]
For I in range (2) :
For j in range (4) :
Count +=1
E1=Button (top, text=STR (l1] [count - 1), fg='chocolate', width=9, bg='linen', the command=l2 [] count - 1)
E1. The grid ()
Canvas. Create_window (100 * j, 100 * I, width=80, height=40, window=e1, anchor=N + W)

Top. Mainloop ()

Root=Tk ()
Root. Title (' Bangumi anime briefly list ')
Root. Geometry (' 460 x200)
Canvas=canvas (root, width=460, height=200, bd=0, highlightthickness=0)
Imgpath='bj. GIF'
Img=Image. Open (imgpath)
Photo=ImageTk. PhotoImage (img)
Canvas. Create_image (0, 0, image=photo)
Canvas. The grid ()
Lbl1=Label (root, text='Bangumi anime, fg=' white ', bg='gray', the font=(' regular script, 30), bd=0). The place (x=120, y=20)
Lbl2=Label (root, text='brief ranking, fg=' white ', bg='gray', the font=(" regular script ", 15), bd=0). The place (x=230, y=70)
Button (root, width=20, text='top 100 tags proportion, the font=' be ', the command=create1). The place (=10 x, y=120)
Button (root, width=20, text='label index, the font=' be ', the command=create2). The place (x=240, y=120)
Root. Mainloop ()
  • Related