[英]Error when creating file opening window by using tkinter library
我指的是這篇文章: Tkinter not created a window? . 並且作為答案發布的代碼在我的代碼中返回了相同的錯誤: TclError: no display name and no $DISPLAY environment variable
這是我的代碼:
import tkinter
root = tkinter.Tk()
root.title = ('Project planner')
open_button = tkinter.Button(root, text='Open project...', command=open_project)
open_button.pack(side='top')
canvas = tkinter.Canvas(root, width=800, height=400, bg='white')
canvas.pack(side='bottom')
tkinter.mainloop()
怎么了?
我應該在本地運行我的代碼,然后它可以工作,它不能在服務器上工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.