完善V1.4踢乒乓球版本
This commit is contained in:
1 parent
d14fe6c37b
commit
72455a5e76
1864 files changed
+19294
-218
No files matched your search
@@ -0,0 +1,12 @@
|
||||
from threading import Lock
|
||||
|
||||
|
||||
PRINT_LOCK = Lock()
|
||||
|
||||
|
||||
def locked_print(string: str):
|
||||
"""Print with a lock to prevent garbled output for multiple threads."""
|
||||
with PRINT_LOCK:
|
||||
# print only prints so much, break up the string into lines
|
||||
for line in string.splitlines():
|
||||
print(line)
|
||||
Reference in new issue
Block a user