易截截图软件、单文件、免安装、纯绿色、仅160KB

串口通讯的python模块——pySerial

pySerial
Overview
This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named "serial" automatically selects the appropriate backend.
It is released under a free software license, see LICENSE.txt for more details.
(C) 2001-2008 Chris Liechti cliechti@gmx.net
The project page on SourceForge and here is the SVN repository and the Download Page.
The homepage is on http://pyserial.sf.net/
Features
same class based interface on all supported platforms
access to the port settings through Python 2.2+ properties
port numbering starts at zero, no need to know the port name in the user program
port string (device name) can be specified if access through numbering is inappropriate
support for different bytesizes, stopbits, 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. They depend on non standard but common packages on Windows (pywin32) and Jython (JavaComm). POSIX (Linux, BSD) uses only modules from the standard Python distribution)
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.
Requirements
Python 2.2 or newer
pywin32 extensions on Windows
"Java Communications" (JavaComm) or compatible extension for Java/Jython
Installation
from source
Extract files from the archive, open a shell/console in that directory and let Distutils do the rest:
python setup.py install
The files get installed in the "Lib/site-packages" directory.
easy_install
An EGG is available from the Python Package Index: http://pypi.python.org/pypi/pyserial
easy_install pyserial
windows installer
There is also a Windows installer f


相关文档:

python猜数字游戏

from random import randint              #导入随即函数
def guessNum():                          &nbs ......

python 中使用paramiko简单连接

在paramiko中使用用户名和密码通过sftp传输文件,不使用key文件。
import getpass
import select
import socket
import traceback
import paramiko
def putfile():
#import interactive
# setup logging
paramiko.util.log_to_file('demo.log')
username = username
hostname = hostname
......

Python 3 输出重定向使用C/C++

Python 3 输出重定向使用C/C++
By:gddsky
 
目标
希望将Python 3的输出重定向到自定义的输出目标。
 
核心
Python使用sys.stdout、sys.stderr做输出目标,只要我们替换这两个值就可以重定向到我们自定义目标。替换的值的规则在Python的文档中sys (module)的sys.stdout上面说明只要添加一个write函数就可以 ......

vim 的python 语法高亮

vim支持大部分文件格式的语法高亮,而且可以自定义。不过缺省的python语法高亮感觉太少,修改一下。
1.修改语法高亮文件
vim/vim72/syntax/python.vim
将"    let python_highlight_all = 1
前面的引号去掉,可支持内置函数,数字,空格,异常的语法高亮。
2. 将self加进
syn keyword pythonBuiltin&n ......

在Linux系统上实现用Python远程访问Oracle数据库

1、下载oracle软件
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
oracle-instantclient-basic-10.2.0.4-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
oracle-instantclient-devel-10.2.0.4-1.i386.rpm
2、安装rpm包
rpm -ivh oracle-instantclient-basic-10.2.0.4 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号