python - Pygame - Printing out seconds using Time -


this may simple, yet can't figure out way this; trying print seconds. use:

r = int(pygame.time.get_ticks) print(r/1000) 

it prints out seconds want print out seconds once. output like: 11111112222222233333333..., when looking like: 1 2 3...
if can me out, id appreciate it. thank you.

you need track last value seconds, , print if new value seconds changes.

last_seconds = none while true:     # run game     r = int(pygame.time.get_ticks)     seconds = r / 1000     if seconds != last_seconds:         print(seconds)         last_seconds = seconds 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -