'Vpython text as current time
I'm a beginner with vpython, trying to make something like clock using text. The problem is that text actually changes but the older one stays, I have tried setting up visibility to flase, but it starts blinking. Is there proper way to do it?
from vpython import *
import time
while True:
rate(1000)
hour=time.localtime(time.time())[3]
minute=time.localtime(time.time())[4]
second=time.localtime(time.time())[5]
textHour = str(hour)
textHour = textHour.zfill(2)
textMinute = str(minute)
textMinute = textMinute.zfill(2)
textSecond = str(second)
textSecond = textSecond.zfill(2)
current_time = textHour + ":" + textMinute + ":" + textSecond
myLabel = text(text=current_time, align='center', color=color.orange, pos=vector(0,0,0))
# myLabel.visible=False
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
