I'm trying to pass a list as an argument to a threaded function. This list can vary in it's length, but I can't figure out how to do it. Below is the code I'm using. For now, I just want to be able to get the list into the threaded function and print it on-screen.
#!/usr/bin/python
import threading
import Queue as queue
def generateRange(starting_chars=(*args)):
print str(starting_chars)
for i in range(32,126):
q = queue.Queue()
theArgs = [i,32,32]
threads = [ threading.Thread(target=generateRange,args=theArgs) ]
# generateRange([i,32,32])
for th in threads:
th.daemon = True
th.start()
I'm getting this error:
File "./test.py", line 6
def generateRange(starting_chars=(*args)):
^
SyntaxError: invalid syntax
What am I doing wrong?