Created
January 27, 2020 19:14
-
-
Save bDrwx/ac55c75318ffca01f3abdca0a145856b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pylint: disable=wrong-import-position | |
if sys.platform == 'cli': | |
from serial.serialcli import Serial | |
else: | |
import os | |
# chose an implementation, depending on os | |
if os.name == 'nt': # sys.platform == 'win32': | |
from serial.serialwin32 import Serial | |
elif os.name == 'posix': | |
from serial.serialposix import Serial, PosixPollSerial, VTIMESerial # noqa | |
elif os.name == 'java': | |
from serial.serialjava import Serial | |
else: | |
raise ImportError("Sorry: no implementation for your platform ('{}') available".format(os.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment