Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃpython²Ù×÷´®¿Ú

Ò»¡¢
ΪÁËʹÓÃpython²Ù×÷´®¿Ú£¬Ê×ÏÈÐèÒªÏÂÔØÏà¹ØÄ£¿é:
1. pyserial (http://pyserial.wiki.sourceforge.net/pySerial)
2. pywin32 (http://sourceforge.net/projects/pywin32/)
¶þ¡¢
google “python ´®¿Ú ²Ù×÷”¹Ø¼ü×Ö£¬ÕÒµ½Ïà¹Øpython´úÂ룬
ÎÒÊÇ´Óhttp://currentlife.blog.sohu.com/53741351.htmlÒ³ÃæÉÏ¿½±´µÄ´úÂë¡£
Ô۵òο¼È˼ҵĴúÂëÐ޸ġ£
Èý¡¢
·¢ËÍÊý¾Ý¿ÉÓÃchrºÍpack×é×°´¦Àí£¬È磺
snd = ''
snd += chr(97)
data = 0x12345678
snd += pack.('i', data)
snd += chr(0x64)
self.l_serial.write(snd);
#·¢Ë͵ÄÊý¾ÝÊÇ(16½øÖÆ)£º61 78 56 34 12 64
½ÓÊÕµÄÊý¾ÝÓÃordº¯Êý£¬½«×Ö½ÚÄÚÈݱäΪÕûÊý£¬½øÐÐÅжϴ¦Àí¡£
È磺if ord(recv[2])== 0x01:
ÅжÏrecv[2]ÊÇ·ñÊÇ0x01.
×¢Ò⣺²»ÄÜÕâÑù±È½Ï
if recv[2] == 'a':
   pass
Ò²²»ÄÜÕâÑù±È½Ï
if recv[2] == 0x97:
   pass
ÒòΪpythonµÄ×Ö·û´®´æ´¢»úÖÆÎÒ²»Çå³þ£¬ËùÒÔ²»ÖªµÀΪʲôÕâÑù±È½Ï²»¿ÉÒÔ¡£
Ìûµã´úÂ룬ÒÀ¾ÝÇ°ÃæµÄ²Î¿¼´úÂëÐ޸ĵģº
#coding=gb18030
import sys,threading,time;
import serial;
import binascii,encodings;
import re;
import socket;
from struct import *;
class ComThread:
    def __init__(self, Port=0):
        self.l_serial = None;
        self.alive = False;
        self.waitEnd = None;
        self.port = Port;
    def waiting(self):
        if not self.waitEnd is None:
            self.waitEnd.wait();
    def SetStopEvent(self):
        if not self.waitEnd is None:
            self.waitEnd.set();
        self.alive = False;
        self.stop();
    def start(self):
        self.l_serial = serial.Serial();
        self.l_serial.port = self.port;
        self.l_se


Ïà¹ØÎĵµ£º

python¼òµ¥µÄ¿ÉÄæ¼ÓÃܳÌÐò

¼òµ¥¼ÓÃÜ£¬ÓÃpythonÀ´Ð´Ð´¡£
#coding=utf-8
'''
Description: ¿ÉÄæµÄ¼ÓÃÜÓë½âÃÜ
Environment: python2.5.x
Author:idehong@gmail.com
'''
import os
import sys
class Code(object):
'''¿ÉÄæµÄ¼ÓÃÜÓë½âÃÜ'''

def __init__(self, key = "idehong@gmail.com"):
self.__src_key ......

python ¶ÁдExcelÎļþ

http://sourceforge.net/projects/pyexcelerator/
12ÔÂ2ÈÕ
python ¶ÁдExcelÎļþ£¨×ªÌû limodou£©
http://www.lexicon.net/sjmachin/xlrd.htm
Õâ¸ö°üÊÇÓÃÀ´¶ÁExcelÎļþµÄ
ÔÚ·¢ÏÖ xlrd Ö®ºó²»¾Ã¾Í·¢ÏÖÁË pyExcelerator
£¬ËüÓë xlrd ²»Í¬£¬ËüÖ÷ÒªÊÇÓÃÀ´Ð´ Excel Îļþ£¬µ±È»¶ÁÒ²ÊÇûÓÐÎÊÌâµÄ¡£ÏÂÃæ¾ÍËüµÄʹÓüòµ¥µØ½éÉ ......

Óà python ¿ìËٴÍøÓηþÎñÆ÷

ÀµÓºƣ¨http://laiyonghao.com£©
½ñÌ죨2009Äê5ÔÂ31ÈÕ£© OurPNP.org ¸ãÁ˸ö¾Û»á»î¶¯£¬ÅªÁËÊ®¼¸¶þÊ®¸öÈËÔÚ¹ãÖݺ£Öé¹ã³¡µÄÌûá´ôÁËÎå¸öСʱ£¬´´ÏÂÁËÎÒÔÚ K ·¿´ôµÄ×ʱ¼ä¼Í¼¡£Ó¦ËûÃǵÄÑûÇ룬ÎÒ×öÁ˸öÌâΪ¡¶Óà python ¿ìËٴÍøÓηþÎñÆ÷¡·µÄСÑݽ²£¬ÒòΪÄDZߵĵçÊÓ¾¹È»²»ÄܽӵçÄÔ£¬ËùÒÔ½²µÄʱºòûÓÐÄܹ»²ÎÕÕ PPT À´½²£¬¹Û ......

ʹÓÃpy2exe´ò°üpython½Å±¾£¨except 2.6£©

Ò»¡¢¼ò½é
py2exeÊÇÒ»¸ö½«python½Å±¾×ª»»³ÉwindowsÉϵĿɶÀÁ¢Ö´ÐеĿÉÖ´ÐгÌÐò(*.exe)µÄ¹¤¾ß£¬ÕâÑù£¬Äã¾Í¿ÉÒÔ²»ÓÃ×°python¶øÔÚwindowsϵͳÉÏÔËÐÐÕâ¸ö¿ÉÖ´ÐгÌÐò¡£
py2exeÒѾ­±»ÓÃÓÚ´´½¨wxPython,Tkinter,Pmw,PyGTK,pygame,win32com clientºÍserver,ºÍÆäËüµÄ¶ÀÁ¢³ÌÐò¡£py2exeÊÇ·¢²¼ÔÚ¿ªÔ´Ðí¿É֤ϵġ£
¶þ¡¢°²×°py2exe ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ