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 8b74c8e commit 0f81cfbCopy full SHA for 0f81cfb
examples/server/test_client.py
@@ -1,7 +1,10 @@
1
import requests, json, base64
2
from io import BytesIO
3
from PIL import Image, PngImagePlugin, ImageShow
4
-from threading import Thread
+import os
5
+if os.name == 'nt':
6
+ from threading import Thread
7
+
8
9
from typing import List
10
@@ -128,9 +131,12 @@ def showImages(imgs: List[Image.Image]) -> None:
128
131
None
129
132
"""
130
133
for (i,img) in enumerate(imgs):
- t = Thread(target=show_img, args=(img, f"IMG {i}"))
- t.setDaemon(True)
- t.start
134
+ if os.name == 'nt':
135
+ t = Thread(target=show_img, args=(img, f"IMG {i}"))
136
+ t.setDaemon(True)
137
+ t.start
138
+ else:
139
+ show_img(img, f"IMG {i}")
140
141
def saveImages(imgs: List[Image.Image], path: str) -> None:
142
0 commit comments