import time
from tkinter import *
class Timer( Tk) :
def __init__ ( self ) :
Tk. __init__ ( self )
self .geometry ( '160x40' )
self .resizable ( 0 , 0 )
self .start = round ( time .time ( ) )
self .m = Label( self , text= 'Seconds: ' + str ( self .start ) , fg= 'green' , font= 30 )
self .m .place ( x= 35 , y= 8 )
time .sleep ( 1 )
self .tick ( )
self .mainloop ( )
def tick( self ) :
self .m .configure ( text= 'Seconds: ' +str ( round ( time .time ( ) -self .start ) ) )
self .after ( 1000 , self .tick )
t = Timer( )
aW1wb3J0IHRpbWUKZnJvbSB0a2ludGVyIGltcG9ydCAqCgpjbGFzcyBUaW1lcihUayk6CiAgICAKICAgIGRlZiBfX2luaXRfXyAoc2VsZik6CiAgICAgICAgVGsuIF9faW5pdF9fKHNlbGYpCiAgICAgICAgc2VsZi5nZW9tZXRyeSgnMTYweDQwJykKICAgICAgICBzZWxmLnJlc2l6YWJsZSgwLDApCiAgICAgICAgc2VsZi5zdGFydD0gcm91bmQodGltZS50aW1lKCkpCiAgICAgICAgc2VsZi5tID0gTGFiZWwoc2VsZix0ZXh0PSdTZWNvbmRzOiAnICsgc3RyKHNlbGYuc3RhcnQpLGZnPSdncmVlbicsZm9udD0zMCkKICAgICAgICBzZWxmLm0ucGxhY2UoeD0zNSx5PTgpCiAgICAgICAgdGltZS5zbGVlcCgxKQogICAgICAgIHNlbGYudGljaygpCiAgICAgICAgc2VsZi5tYWlubG9vcCgpCgogICAgZGVmIHRpY2soc2VsZik6CiAgICAgICAgc2VsZi5tLmNvbmZpZ3VyZSh0ZXh0PSdTZWNvbmRzOiAnK3N0cihyb3VuZCh0aW1lLnRpbWUoKS1zZWxmLnN0YXJ0KSkpCiAgICAgICAgc2VsZi5hZnRlcigxMDAwLCBzZWxmLnRpY2spCiAgICAgICAgCnQgPSBUaW1lcigp
stdout
stderr
Traceback (most recent call last):
File "./prog.py", line 21, in <module>
File "./prog.py", line 7, in __init__
File "/usr/lib/python3.4/tkinter/__init__.py", line 1854, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable