Python ´®¿ÚÉ豸ӦÓÃ
1. Python ´®¿ÚÉ豸ӦÓÃ
¼òÊö
1.1. Ïß³ÌÂÖѰ
·ç³¾ÎÞÏÞ <tianyu263@163.com>
-- ·ÖÏí
¾ÍÊÇ´ò¿ª´®¿Úºó£¬Æô¶¯Ò»¸öÏß³ÌÀ´¼àÌý´®¿ÚÊý¾ÝµÄ½øÈ룬ÓÐÊý¾Ýʱ£¬¾Í×öÊý¾ÝµÄ´¦Àí£¨Ò²¿ÉÒÔ·¢ËÍÒ»¸öʼþ£¬²¢Ð¯´ø½ÓÊÕµ½µÄÊý¾Ý£©¡£
Toggle line numbers
1
2 #coding=gb18030
3
4 import sys,threading,time;
5 import serial;
6 import binascii,encodings;
7 import re;
8 import socket;
9
10 class ReadThread:
11 def __init__(self, Output=None, Port=0, Log=None, i_FirstMethod=True):
12 self.l_serial = None;
13 self.alive = False;
14 self.waitEnd = None;
15 self.bFirstMethod = i_FirstMethod;
16 self.sendport = '';
17 self.log = Log;
18 self.output = Output;
19 self.port = Port;
20 self.re_num = None;
21
22 def waiting(self):
23 if not self.waitEnd is None:
24 self.waitEnd.wait();
25
26 def SetStopEvent(self):
27 if not self.waitEnd is None:
28 self.waitEnd.set();
29 self.alive = False;
30 self.stop();
31
32 def start(self):
33 self.l_serial = serial.Serial();
34 self.l_serial.port = self.port;
35 self.l_serial.baudrate = 9600;
36 self.l_serial.timeout = 2;
37
38 self.re_num = re.compile('\d');
39
40 try:
41 if not self.output is None:
42 self.output.WriteText(u'´ò¿ªÍ¨Ñ¶¶Ë¿Ú\r\n');
43 if not self.log is None:
44 self.log.info(u'´ò¿ªÍ¨Ñ¶¶Ë¿Ú');
45 self.l_serial.open();
46 except Exception, ex:
47 if self.l_serial.isOpen():
48 self.l_serial.close();
49
50 self.l_serial = None;
51
52 if not self.output is None:
53 self.output.WriteText(u'³ö´í£º\r\n %s\r\n' % ex);
54 if not self.log is None:
Ïà¹ØÎĵµ£º
Python×÷ΪһÖÖ¹¦ÄÜÇ¿´óÇÒͨÓõıà³ÌÓïÑÔ¶ø¹ãÊÜºÃÆÀ£¬Ëü¾ßÓзdz£ÇåÎúµÄÓï·¨ÌØµã£¬ÊÊÓÃÓÚ¶àÖÖ²Ù×÷ϵͳ£¬Ä¿Ç°ÔÚ¹ú¼ÊÉϷdz£Á÷ÐУ¬ÕýÔڵõ½Ô½À´Ô½¶àµÄÓ¦Óá£
ÏÂÃæ¾ÍÈÃÎÒÃÇÒ»ÆðÀ´¿´¿´ËüµÄÇ¿´ó¹¦ÄÜ£º
Python£¨ÅÉÉ£©£¬ËüÊÇÒ»¸ö¼òµ¥µÄ¡¢½âÊÍÐ͵ġ¢½»»¥Ê½µÄ¡¢¿ÉÒÆÖ²µÄ¡¢ÃæÏò¶ÔÏóµÄ³¬¸ß¼¶ÓïÑÔ¡£Õâ¾ÍÊǶÔPython ......
´úÂëÈçÏ£º
#!/usr/bin/env python
# -*-coding:UTF-8-*-#
from common import *
import Image, ImageFilter, math, sys, os, random
def modifyImageObj(img, matrix) :
width, height = img.size
for h in range(0, height) :&n ......
http://sourceforge.net/projects/pyexcelerator/
12ÔÂ2ÈÕ
python ¶ÁдExcelÎļþ£¨×ªÌû limodou£©
http://www.lexicon.net/sjmachin/xlrd.htm
Õâ¸ö°üÊÇÓÃÀ´¶ÁExcelÎļþµÄ
ÔÚ·¢ÏÖ xlrd Ö®ºó²»¾Ã¾Í·¢ÏÖÁË pyExcelerator
£¬ËüÓë xlrd ²»Í¬£¬ËüÖ÷ÒªÊÇÓÃÀ´Ð´ Excel Îļþ£¬µ±È»¶ÁÒ²ÊÇûÓÐÎÊÌâµÄ¡£ÏÂÃæ¾ÍËüµÄʹÓüòµ¥µØ½éÉ ......
* PYTHON Ç÷ÏòÓÚ½«¹¦ÄÜÏà½üµÄ¶ÔÏó·Å½øÒ»¸öMODULE£¨Îļþ£©À²»Óõ£ÐĶÔÏó»áÌ«´ó£¬ÒòΪÈç¹û¶ÔÏóÌ«´óÁË£¬ÄÇËü¿ÉÄÜÊÇ×öµÄÊÂÐÔÌ«¶àÁË
ÐèÒª±»Öع¹¡¢·Ö½â¡£
* ¿ª·¢¸¨Öú¹¤¾ßÊÇPYTHONµÄÒ»¸öÇ¿Ïî¡£Èç¹¹½¨¹¤¾ß¡¢Í³¼Æ¹¤¾ßµÈµÈ£¬Ö»ÒªÓÐÐèÇó£¬ËüÒ»¶¨°ìµÃµ½£¬ÒòΪÕâЩӦÓö԰²È«ºÍÐÔÄÜÒªÇ󲻸ߣ¬·´
¶ø¶Ô¿ª· ......
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 ......