pyserial 3.5
История выпусков Уведомления о выпусках | Лента RSS
Эта версия
3.5b0 предварительный выпуск
Загрузка файлов
Загрузите файл для вашей платформы. Если вы не уверены, какой выбрать, узнайте больше об установке пакетов.
Источник распределения
Uploaded 23 нояб. 2020 г. source
Построенный дистрибутив
Uploaded 23 нояб. 2020 г. py2 py3
Хеши для pyserial-3.5.tar.gz
| Алгоритм | Хеш-дайджест | |
|---|---|---|
| SHA256 | 3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb | Копировать |
| MD5 | 1cf25a76da59b530dbfc2cf99392dc83 | Копировать |
| BLAKE2b-256 | 1e7dae3f0a63f41e4d2f6cb66a5b57197850f919f59e558159a4dd3a818f5082 | Копировать |
Хеши для pyserial-3.5-py2.py3-none-any.whl
| Алгоритм | Хеш-дайджест | |
|---|---|---|
| SHA256 | c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0 | Копировать |
| MD5 | b6b182ebaf20199e9788214cae349df4 | Копировать |
| BLAKE2b-256 | 07bc587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558 | Копировать |
Помощь
О PyPI
Внесение вклада в PyPI
Использование PyPI
Разработано и поддерживается сообществом Python’а для сообщества Python’а.
Пожертвуйте сегодня!
PyPI», «Python Package Index» и логотипы блоков являются зарегистрированными товарными знаками Python Software Foundation.
installing and using pyserial in python 3.4 windows 8.1
I want to use pyserial but I do not know what I am doing wrong I have installed python 3.4.2 from this link www-python-org-downloads-release-python-342- the one that says «Windows x86-64 MSI installer» and I got this archive «python-3.4.2.amd64.msi» because my operating system is 64 bit during the installation I have selected «add python.exe to path» (will be installed on local hard drive), and all the other ones I went to the pyserial website http://pyserial.sourceforge.net/pyserial.html#installation which say «Download the archive from http://pypi.python.org/pypi/pyserial. Unpack the archive, enter the pyserial-x.y directory and run:» and sent me to this link http-pypi-python-org-pypi-pyserial I have donwloaded from this link, these three archives pyserial-2.7.tar.gz, pyserial-2.7.win32.exe pyserial-2.7.win32_py3k.exe I have tried to run the .exe one but they say «No python installation found in the registry», which I dont know why then I unpack the .gz file with Winrar enter into the folder and try to run «pyserial-x.y» but there is nothing like that in this folder in this folder I can find
documentation (folder) examples serial test CHANGES.txt LICENSE.txt MANIFEST.in PKG-INFO README.txt setup.py
I tried to run this «setup.py» but for a second a black window appears
detected Python 3, using 2to3 C;\Python34\lib\distutils\dist.py:260: UserWarning: Unknow distribution option: use_2to3 warning.warn(msg) usage: setup.py [global_opts] [cmd1_opts] [cmd2 [cmd2_opts] . ] or: setup.py --help [cmd1 cmd2 . ] or: setup.py --help commands or: setup.py cmd --help error: no commands supplied
and then disappears I went to the command prompt and wrote «python3 setup.py install» or python setup.py install but it says Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Users\me>python3 setup.py install ‘python3’ is not recognized as an internal or external command operable program or batch file. so I cant do that either then in command prompt I chancge the directory with «cd C:\Users\me\Downloads\pyserial-2.7» which is the place where the folder .gz is then «python setup.py install» and «python3 setup.py install» but they do not work there is the code and at the end it says
C:\Users\me\Downloads\pyserial-2.7>python setup.py install Detected Python 3, using 2to3 C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'use_2to3' warnings.warn(msg) running install running build running build_py running build_scripts running install_lib running install_scripts running install_egg_info Removing C:\Python34\Lib\site-packages\pyserial-2.7-py3.4.egg-info Writing C:\Python34\Lib\site-packages\pyserial-2.7-py3.4.egg-info C:\Users\me\Downloads\pyserial-2.7>
then I try to write in the command prompt «python» then «import serial» but still it does not work THEN i DO NOT KNOW WHAT TO DO could somebody help me
pySerial¶
This module encapsulates the access for the serial port. It provides backends for Python running on Windows, OSX, Linux, BSD (possibly any POSIX compliant system) and IronPython. The module named “serial” automatically selects the appropriate backend.
It is released under a free software license, see LICENSE for more details.
Copyright (C) 2001-2020 Chris Liechti
Other pages (online)
- project page on GitHub
- Download Page with releases (PyPi)
- This page, when viewed online is at https://pyserial.readthedocs.io/en/latest/ or http://pythonhosted.org/pyserial/ .
Features¶
- Same class based interface on all supported platforms.
- Access to the port settings through Python properties.
- Support for different byte sizes, stop bits, parity and flow control with RTS/CTS and/or Xon/Xoff.
- Working with or without receive timeout.
- File like API with “read” and “write” (“readline” etc. also supported).
- The files in this package are 100% pure Python.
- The port is set up for binary transmission. No NULL byte stripping, CR-LF translation etc. (which are many times enabled for POSIX.) This makes this module universally useful.
- Compatible with io library
- RFC 2217 client (experimental), server provided in the examples.
Requirements¶
- Python 2.7 or Python 3.4 and newer
- If running on Windows: Windows 7 or newer
- If running on Jython: “Java Communications” (JavaComm) or compatible extension for Java
For older installations (older Python versions or older operating systems), see older versions below.
Installation¶
This installs a package that can be used from Python ( import serial ).
To install for all users on the system, administrator rights (root) may be required.
From PyPI¶
pySerial can be installed from PyPI:
python -m pip install pyserial
Using the python / python3 executable of the desired version (2.7/3.x).
Developers also may be interested to get the source archive, because it contains examples, tests and the this documentation.
From Conda¶
pySerial can be installed from Conda:
conda install pyserial or conda install -c conda-forge pyserial
Currently the default conda channel will provide version 3.4 whereas the conda-forge channel provides the current 3.x version.
From source (zip/tar.gz or checkout)¶
Download the archive from http://pypi.python.org/pypi/pyserial or https://github.com/pyserial/pyserial/releases. Unpack the archive, enter the pyserial-x.y directory and run:
python setup.py install
Using the python / python3 executable of the desired version (2.7/3.x).
Packages¶
There are also packaged versions for some Linux distributions:
- Debian/Ubuntu: “python-serial”, “python3-serial”
- Fedora / RHEL / CentOS / EPEL: “pyserial”
- Arch Linux: “python-pyserial”
- Gentoo: “dev-python/pyserial”
Note that some distributions may package an older version of pySerial. These packages are created and maintained by developers working on these distributions.
References¶
- Python: http://www.python.org/
- Jython: http://www.jython.org/
- IronPython: http://www.codeplex.com/IronPython
Older Versions¶
Older versions are still available on the current download page or the old download page. The last version of pySerial’s 2.x series was 2.7, compatible with Python 2.3 and newer and partially with early Python 3.x versions.
pySerial 1.21 is compatible with Python 2.0 on Windows, Linux and several un*x like systems, MacOSX and Jython.
On Windows, releases older than 2.5 will depend on pywin32 (previously known as win32all). WinXP is supported up to 3.0.1.
© Copyright 2001-2020, Chris Liechti Revision 7aeea354 .
Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions latest stable Downloads pdf html epub On Read the Docs Project Home Builds Free document hosting provided by Read the Docs.
Serial-порт: как с ним работать?

Очень часто при отладке различных программ на Arduino используется так называемый Serial-порт. Из него можно как считывать данные, так и отправлять команды на наше устройство.
Посмотрим, как работать с Serial, но не со стороны Arduino, а со стороны компьютера. Готовы? Поехали!
Вариант первый. Arduino IDE
Один из инструментов, входящих в состав Arduino IDE, носит гордое название — Монитор порта. Он может быть запущен только когда плата подключена к компьютеру. Есть возможность изменять скорость передачи данных, и символ окончания строки.


Если мы хотим работать только с текстом — рабочий вариант, но если при подключении открывается консоль(например в случае с Micropython), об удобстве можно забыть.
Вариант второй. Специализированное ПО
Поскольку интерфейс Serial-порта используется не только при разработке микроконтроллеров, но и в других областях IT были созданы специальные программы, для удобного взаимодействия или управления.
Одним из самых популярных решений для Windows — является программа PuTTY. Не смотря на то, что она заявлена как SSH клиент, её очень часто используют для подключения по COM-порту.


Для этого необходимо на основной вкладке среди способов подключения выбрать Serial , ввести имя порта, скорость и нажать на Open .
К сожалению данная программа доступна только для Windows. Пользователям MacOS — можно использовать CoolTerm(кстати, он доступен и для Windows и Linux)


или программу с простым названием Serial, правда за её использование после пробного периода придётся отдать 30$.


Вариант третий. Программирование
Но в том случае, когда у вас уже готовое устройство и вам необходимо им управлять, каждый раз отправлять команду — очень не удобно. Гораздо проще автоматизировать это, написав свою программу.
Для того, что бы написать программу для управления устройством через Serial-порт на Python, необходимо использовать библиотеку PySerial . Её можно установить через менеджер пакетов: pip install pyserial .
Для создания подключения и отправки сообщения необходим следующий код:
my_serial = serial.Serial('/dev/ttyS1', 115200) my_serial.write(b'command_1') my_serial.close()
Он откроет подключение на порту /dev/ttyS1 , со скоростью 115200 , затем отправит на устройство байтовую строчку b’command_1′ , а после этого закроет подключение.
Подробнее об использовании библиотеки можно прочитать в этой статье.
Данная статья является собственностью Amperkot.ru. При перепечатке данного материала активная ссылка на первоисточник, не закрытая для индексации поисковыми системами, обязательна.