Python Forum

Full Version: Cloud server running(Can be edited directly online)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Error:
TclError Traceback (most recent call last) <ipython-input-2-59f0c474d547> in <module>() 3 import tkinter,qrcode,time 4 import tkinter.messagebox ----> 5 window = tkinter.Tk() 6 window.title('二维码生成器') 7 window.geometry('500x200') /usr/lib/python3.6/tkinter/__init__.py in __init__(self, screenName, baseName, className, useTk, sync, use) 2021 baseName = baseName + ext 2022 interactive = 0 -> 2023 self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) 2024 if useTk: 2025 self._loadtk() TclError: no display name and no $DISPLAY environment variable
YES!IT'S me.
The child that coding aagly(?).
this link
Can be edited directly online:
https://colab.research.google.com/drive/...sp=sharing
THANKS!!!
(PLESE DON'T SAYS ME:agly?)

P.S.:(important)
running on pycharm ,the code is fine.
but on the cloud server is wrong.
For all practical purposes you cannot have Tkinter GUI running on Colab.
You can emulate display but you will not be able to interact with it.

See
https://stackoverflow.com/q/61168210/4046632
https://stackoverflow.com/q/49478228/4046632


On a general note - Please, don't ask/offer people to edit your code directly online. You should post enough information (minimal reproducible example) - code (in python tags), traceback (in error tags), input/output data, etc. so that people on the forum can reproduce the problem and answer.
I strongly advise you to visit the help center