title: $DISPLAY environment problem with Tkinter in VScode
body: <p>I'm trying to build a simple countdown timer using tkinter, however when I run the code the following message appears:</p>
  <pre><code>File &quot;/home/user/Desktop/Beginner Projects/Pythons/countdown timer.py&quot;, line 20, in &lt;module&gt;
      root = Tk()
    File &quot;/usr/lib/python3.8/tkinter/__init__.py&quot;, line 2261, in __init__
      self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
  _tkinter.TclError: no display name and no $DISPLAY environment variable
  </code></pre>
  <p>I searched a lot for answers but did not understood most of them. How can I solve this problem and get tkinter to work on VScode? Thanks in advance!</p>
  <p>Edit 1:</p>
  <pre><code>from tkinter import *
  from tkinter import ttk
  from tkinter import font
  import time
  import datetime
  
  global endTime
  
  def quit(*args):
      root.destroy()
  
  def cant_wait():
      timeLeft = endTime - datetime.datetime.now()
      timeLeft = timeLeft - datetime.timedelta(microseconds=timeLeft.microseconds)
  
      txt.set(timeLeft)
  
      root.after(1000, cant_wait)
  
  root = Tk()
  root.attributes(&quot;-fullscreen&quot;,False)
  root.configure(background=&quot;black&quot;)
  root.bind(&quot;x&quot;, quit)
  root.after(1000, cant_wait)
  
  endTime = datetime.datetime(2020,6,7,8,0,0)
  
  fnt = font.Font(family=&quot;Helvetica&quot;, size=90, weight=&quot;bold&quot;)
  txt = StringVar()
  lbl = ttk.Label(root, textvariable=txt, font=fnt, foreground=&quot;white&quot;, background=&quot;black&quot;)
  lbl.place(relx = 0.5, rely = 0.5, anchor=&quot;center&quot;)
  
  root.mainloop()
  </code></pre>