-1

I am trying to write a Python server that works to display the name of a song I'm listening to on Pandora. Whenever the song changes, my Pandora program sends the information about the new song name to my Python server. However, I would like Python to display that song name with Tkinter, which means I'll have to call a mainloop. But if I call a mainloop, I can't go back to waiting for client calls from my pandora program. In other words, my server program needs booth to loop while waiting for clients and loop for displaying images. What should I do?

Dale Markowitz
  • 191
  • 1
  • 1
  • 9

1 Answers1

0

To acheive concurrency you will have to use threading and use multiple threads in python. You can also acheive your goal using asynchronous frameworks like Twisted http://twistedmatrix.com/trac/ More about synchronous and asynchronous programming http://krondo.com/?p=1209

Saurabh7
  • 710
  • 1
  • 5
  • 18