How come I can't get get my background thread to output anything?

grocery_stocker cdalten at gmail.com
Fri Apr 10 04:01:31 CEST 2009


On Apr 9, 6:36 pm, grocery_stocker <cdal... at gmail.com> wrote:
> Given the following....
>
> #!/usr/local/bin/python
>
> import os
> import time
> import thread
>
> def domsg(string, sleeptime, *args):
>     print "%s was here", string
>     #os.system('tel %s test' % person);
>     #time.sleep(sleeptime)
>
> def buildlist():
>     out = 1
>     persons = []
>
>     while(out != 0):
>         pern = raw_input("Enter person to message:")
>         if (len(pern)):
>             persons.append(pern)
>         else:
>             out = 0
>     return persons
>
> if __name__ == "__main__":
>     #buildlist()
>     thread.start_new_thread(domsg, ("person",2))
>
> I get....
> m-net% ./massmsg.py
> m-net%
>
> I was expecting to see
>
> person  was here




More information about the Python-list mailing list