473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help with Queues and Threading

Hi, all

Thanks all of you who helped me with the threading and queues issue. I
am trying to get it working but I am having problems. When I try to run
the following:
cmddata = mediaplay.initcommandqueue() #initiates the Queue to send
commands down

mediathread = threading.Thread( target=mediaplay.mainloop,
args=(cmddata) ) #starts the main loop, which will wait for a command
then execute it, Queue object passed to it.

threading.Thread.start(mediathread) # start the thread

I get the following error:
Exception in thread Thread-1:

Traceback (most recent call last):
File "/usr/lib/python2.3/threading.py", line 436, in __bootstrap
self.run()
File "/usr/lib/python2.3/threading.py", line 416, in run
self.__target(*self.__args, **self.__kwargs)
TypeError: mainloop() argument after * must be a sequence

But if I run the loop directly (i.e. not using threads, just calling the
function) it works just fine. What could the problem be?

Jul 19 '05 #1
1 1464
Ognjen Bezanov <og****@mailshack.com> writes:
But if I run the loop directly (i.e. not using threads, just calling the
function) it works just fine. What could the problem be?


You have to say args=(cmddata,) with the comma inside the parens,
to make a seqence instead of a parenthesized expression.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Anand Pillai | last post by:
The standard Python Queue module, allows to generate queues that have no size limit, by passing the size argument as <= 0. q = Queue(0) In a multithreaded application, these queues could be...
3
by: Keith Mills | last post by:
Hello, please find attached a basic outline of what I am attempting to accomplish... basically I want to create a number of THREADS (which I can do fine), but I then need a method for them to be...
3
by: Chris Calzaretta | last post by:
Hello Working with system.threading.thread Ok I have an windows user control. It has 3 thread on it thread 1 uploaded files types a thread 2 upload files types b thread 3 upload files types c...
5
by: Sinan Nalkaya | last post by:
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.