Member Avatar for leegeorg07

i just thought i would ask as a reference for the future but if i was to have a loop like this:

import time
mytime = time.asctime()[11:19]
while mytime <= "13:14:15":
    mytime = time.asctime()[11:19]
    raw_input()

how could i change it so that mytime would constantly update as at the moment it will wait until the input is satisfied

Recommended Answers

All 2 Replies

Sounds like you'd want to spawn two threads. One to constantly update mytime and another to wait on the user's input. Is that what you mean?

I'm pretty sure vegaseat has provided a number of examples of spawning threads with subprocess, try searching the forum for some good examples

Member Avatar for leegeorg07

yeah thats about right.
i'll do that.
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.