We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11ecd42 commit 1b4660bCopy full SHA for 1b4660b
scripts/threading_daemon.py
@@ -0,0 +1,28 @@
1
+
2
+import threading
3
+import time
4
+import logging
5
6
7
+def daemon():
8
+ logging.debug('Starting')
9
+ time.sleep(0.2)
10
+ logging.debug('Exiting')
11
12
13
+def non_daemon():
14
15
16
17
18
+logging.basicConfig(
19
+ level=logging.DEBUG,
20
+ format='(%(threadName)-10s) %(message)s',
21
+)
22
23
+d = threading.Thread(name='daemon', target=daemon, daemon=True)
24
25
+t = threading.Thread(name='non-daemon', target=non_daemon)
26
27
+d.start()
28
+t.start()
0 commit comments