Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #68278 > unrolled thread
| Started by | Piyush Verma <114piyush@gmail.com> |
|---|---|
| First post | 2014-03-12 18:39 +0530 |
| Last post | 2014-03-12 18:39 +0530 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
How do we pass default argument value to create thread object? Piyush Verma <114piyush@gmail.com> - 2014-03-12 18:39 +0530
| From | Piyush Verma <114piyush@gmail.com> |
|---|---|
| Date | 2014-03-12 18:39 +0530 |
| Subject | How do we pass default argument value to create thread object? |
| Message-ID | <mailman.8088.1394629972.18130.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
Hi,
I am using Thread class to create threads.
<CODE>
thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"])
thread.start()
</CODE>
This code is throwing compilation error(Ipython).
In [19]: import threading
In [20]: def Fun(agr1, arg2, arg3=None):
....: pass
....:
In [21]: thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"
])
------------------------------------------------------------
File "<ipython console>", line 1
thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"])
^
SyntaxError: invalid syntax
How do we pass the value to default arguments while creating thread object?
Regards,
~Piyush
Facebook <https://www.facebook.com/piyushkv1>
Twitter<https://twitter.com/SocializePiyush>
Back to top | Article view | comp.lang.python
csiph-web