Python Forum
[Tkinter] Cloud server running(Can be edited directly online) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [Tkinter] Cloud server running(Can be edited directly online) (/thread-32227.html)



Cloud server running(Can be edited directly online) - CNenfan - Jan-29-2021

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/1cM2GDu8I9WckK_X4aNBcybASUMz25pTV?usp=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.


RE: Cloud server running(Can be edited directly online) - buran - Jan-29-2021

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