when started "screen5-5.py it instantly starts with "blink_cer" script. and gives a error...
I have 2 Qs
1 how to start "def blink_cer(cer_name):" function WHEN i call it?
2 How to correct this "(cer_name).config(fg='yellow', bg='black')"?
error msg
Traceback (most recent call last):
File "/home/pi/Desktop/screen5-5.py", line 239, in <module>
sog_label.bind('<Button>', blink_cer(aws_cer))
File "/home/pi/Desktop/screen5-5.py", line 33, in blink_cer
(cer_name).config(fg='yellow', bg='black')
File "/usr/lib/python3.5/tkinter/__init__.py", line 1342, in configure
return self._configure('configure', cnf, kw)
File "/usr/lib/python3.5/tkinter/__init__.py", line 1333, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-fg"
My code is like that:
import time
try:
import Tkinter as tk
from Tkinter import *
except ImportError:
import tkinter as tk
from tkinter import *
nmea_data = '$HCHDT,49.9,T'
def blink_cer(cer_name):
(cer_name).config(fg='yellow', bg='black')
print ("WHY?")
def tick(time1=''):
time2 = time.strftime('%M:%S')
....
root = Tk()
root.title("Screen GUI")
....
clock_cer = Frame(info01_frame, width=310, height=135)
clock_cer.pack_propagate(0)
clock_cer.pack(side = LEFT)
clock_label = Label(clock_cer, anchor="e", text='59:59', font=Font104,
padx="10", pady="14", bg='black', fg='#e065ff')
clock_label.pack(fill=BOTH, expand=1)
----
tick()
root.mainloop()