File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22# A simple Python manager for "Turing Smart Screen" 3.5" IPS USB-C display
33# https://github.com/mathoudebine/turing-smart-screen-python
4+
5+ import os
46import signal
5- from datetime import datetime
67import struct
8+ from datetime import datetime
79from time import sleep
10+
811import serial # Install pyserial : pip install pyserial
912from PIL import Image , ImageDraw , ImageFont # Install PIL or Pillow
1013
@@ -129,8 +132,10 @@ def sighandler(signum, frame):
129132
130133 # Set the signal handlers, to send a complete frame to the LCD before exit
131134 signal .signal (signal .SIGINT , sighandler )
132- signal .signal (signal .SIGQUIT , sighandler )
133135 signal .signal (signal .SIGTERM , sighandler )
136+ is_posix = os .name == 'posix'
137+ if is_posix :
138+ signal .signal (signal .SIGQUIT , sighandler )
134139
135140 # Do not change COM port settings unless you know what you are doing
136141 lcd_comm = serial .Serial (COM_PORT , 115200 , timeout = 1 , rtscts = 1 )
You can’t perform that action at this time.
0 commit comments