随笔分类 -  python

摘要:1. Python 串口设备应用简述 1.1. 线程轮寻风尘无限 <tianyu263@163.com>-- 分享 就是打开串口后,启动一个线程来监听串口数据的进入,有数据时,就做数据的处理(也可以发送一个事件,并携带接收到的数据)。 切换行号显示 #coding=gb18030import sys,threading,time;import serial;import binascii,encodings;import re;import socket;class ReadThread: def __init__(self, Output=None, Port=0, Log=No 阅读全文
posted @ 2010-09-15 09:38 dainiao01 阅读(991) 评论(1) 推荐(0)
摘要:pySerialOverviewThis 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 i 阅读全文
posted @ 2010-09-15 09:15 dainiao01 阅读(4313) 评论(1) 推荐(0)
摘要:Python中的easy_install工具很爽,它的作用类似于Php中的pear,或者Ruby中的gem,或者Perl中的cpan。如果想使用easy_install工具,可能需要先安装setuptools,不过更酷的方法是使用ez_setup.py脚本:wget -q http://peak.telecommunity.com/dist/ez_setup.pypython ez_setup.py安装完后,最好确保easy_install所在目录已经被加到PATH环境变量里:Windows: C:/Python25/ScriptsLinux: /usr/local/bin比如说要安装Pyth 阅读全文
posted @ 2010-09-15 09:09 dainiao01 阅读(191) 评论(0) 推荐(0)
摘要:The Python ProfilersCopyright © 1994, by InfoSeek Corporation, all rights reserved.Written by James Roskind. [1]Permission to use, copy, modify, and distribute this Python software and its associated documentation for any purpose (subject to the restriction in the following sentence) without fe 阅读全文
posted @ 2008-04-27 18:43 dainiao01 阅读(292) 评论(0) 推荐(0)
摘要:#!-*- coding: cp936 -*-"#Teraservertestimport threading, time, socket, random,sysimport base64,zipfilethread_count =500TEST_COUNT = 1SPTIME=0.02ISLOG=0MAX_PAGE = 10000HOST = "192.168.6.12"PORT=5534h={}b={}h[1] =[ "POST /httpEntry HTTP/1.1/r/n" ,/ "X-Online-Host: 192.168 阅读全文
posted @ 2008-04-27 16:58 dainiao01 阅读(618) 评论(0) 推荐(0)
摘要:# -*- encoding: utf-8 -*-from ctypes import *import os,timeclass MEMORYSTATUS (Structure): _fields_ = [('dwLength', c_ulong),#sizeof(MEMORYSTATUS) ('dwMemoryLoad',c_ulong), # percent of memory in use ('dwTotalPhys', c_ulong),#; // bytes of physical memory ('dwAvailPhys 阅读全文
posted @ 2008-04-27 16:56 dainiao01 阅读(347) 评论(0) 推荐(0)
摘要:#!python"""Bootstrap setuptools installationIf you want to use setuptools in your package's setup.py, just include thisfile in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools()If you want to require a specif 阅读全文
posted @ 2008-04-27 16:47 dainiao01 阅读(359) 评论(0) 推荐(0)
摘要:#!python"""Bootstrap setuptools installationIf you want to use setuptools in your package's setup.py, just include thisfile in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools()If you want to require a specif 阅读全文
posted @ 2008-04-27 16:45 dainiao01 阅读(903) 评论(0) 推荐(0)