有没有办法调整或移动熊猫表?

时间:2019-01-15 15:29:32

标签: python python-3.x pandas tkinter

所以我有这段代码,但是当我运行它时,pandastable与bookin按钮和表格标题重叠。我该如何调整?我找不到与此有关的任何帮助。

def bookin_bookout():
    global screen10
    screen10 = Toplevel(screen)
    screen10.title('Book In Book Out')
    screen10.geometry('500x500')
    df =pd.read_csv('C:/Users/x64/Desktop/SharedPowerFinal/Data/Users.csv')
    Label(screen10, text = 'Book In', font = ('calibri', 12)) .grid(row=0)
    Button(screen10, text = 'Book In', font = ('calibri', 12)).grid()
    Label(screen10, text = '') .grid()
    Label(screen10, text = '') .grid()
    Label(screen10, text = 'Book Out', font = ('calibri', 12)) .grid()
    scrolledtext.ScrolledText(screen10, width = 40, height = 10)
    Button(screen10, text = 'Book Out', font = ('calibri', 12)) .grid()
    Label(screen10, text = '') .grid()
    Label(screen10, text = '') .grid()
    Button(screen10, text = 'Cancel', font = ('calibri', 12), command = screen10.destroy) .grid()
    table = pandastable.Table(screen10, dataframe=df)
    table.show()

输出: Incorrect bookin/out

现在,这是我以前的代码,在这里我无法设法插入表格,这是在我找到pandastable库之前的,但是至少对于外观和窗口格式而言,它是我的理想输出。我对tkinter真的很陌生,这让我很困扰。

def bookin_bookout():
    global screen10
    screen10 = Toplevel(screen)
    screen10.title('Book In Book Out')
    screen10.geometry('400x600')
    screen.resizable(False, False)

    Label(screen10, text = 'Book In', font = ('calibri', 12)) .pack()
    scrolledtext.ScrolledText(screen10, width = 40, height = 10) .pack()
    Button(screen10, text = 'Book In', font = ('calibri', 12), command = finish_booking) .pack()
    Label(screen10, text = '') .pack()
    Label(screen10, text = '') .pack()
    Label(screen10, text = 'Book Out', font = ('calibri', 12)) .pack()
    scrolledtext.ScrolledText(screen10, width = 40, height = 10) .pack()
    Button(screen10, text = 'Book Out', font = ('calibri', 12), command = finish_booking) .pack()
    Label(screen10, text = '') .pack()
    Label(screen10, text = '') .pack()
    Button(screen10, text = 'Cancel', font = ('calibri', 12), command = screen10.destroy) .pack()

我知道它不适用于你们,但也许您只能通过查看它来提供帮助。

种类繁多的“期望”输出:

Kind of 'desired' output

0 个答案:

没有答案