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

PythonÁ¬½ÓSqlServerÁ·Ï°¼Ç¼


import pymssql

#connect database
conn=pymssql.connect(host="192.168.1.28",user="boomink",password="boomink",
database="boomink")

cur=conn.cursor()

print '========================================'

cur.execute("exec Orders_GetTest1 @Value=%s ",('2005-01-01',))

while 1:
print cur.fetchall()
if 0 == cur.nextset():
break

data=cur.fetchall()

print data

print '========================================'

#cur.execute("exec Orders_GetTest")
cur.execute("exec Orders_GetTest2 @Value1=%s,@Value2=%s",('Ruan','Yu'))

while 1:
print cur.fetchall()


if 0 == cur.nextset():
break

data=cur.fetchall()

print data

print '========================================'

cur.execute("exec Orders_GetTracking @BeginDate=%s,@EndDate=%s",('2005-01-01','2008-01-01'))

record = cur.fetchall()
while 1:
print cur.nextset()

for r in record:
print '========================================'
a=r[1]
print 'OrderId:%s' % r[0]

print r
print '========================================'

if 0 == cur.nextset():
break
print "rnrow count:%d" % cur.rowcount
#commit the connection
conn.commit
#close the connection
conn.close


Ïà¹ØÎĵµ£º

PythonµÄ´®¿ÚͨѶµÚÈý·½¿âPySerial

 ×î½üÒªÓõ½´®¿ÚͨѶ£¬¼òµ¥Ò×ÓõÄPythonÓÖ°ïÉÏæÁË£¬¶à¿÷ÁËÅÓ´óµÄµÚÈý·½×ÊÔ´~~~ £º£©
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 M ......

pythonÖÐÎÄĿ¼

 ÈçÓÐһ·¾¶"e:/software/²âÊÔ.txt" 
ÐèҪͨ¹ýpyhon¶Á/д "²âÊÔ.txt"Îļþ£¬¿ÉÒÔ²ÉÓÃÏÂÃæµÄ·½·¨£º 
ipath = "e:/software/²âÊÔ.txt" 
uipath = unicode(ipath , "utf8") 
È»ºóÓÃ"uipath"¾­¹ý±àÂëºóµÄ·¾¶È¥open()¼´¿É¡£ 
ÏÂÃæÊÇÎÒÔÚÏîÄ¿ÖÐÓÃpython¶ÁдexcelµÄÒ»µãÌå»á(½â¾öÁ˶ÁÖÐÎÄÎļþà ......

Python×Ö·û¼¯±àÂëºÍÎļþ¶Áд

 ÕâÆªÎÄÕ½²µÃ±È½ÏÇå³þpythonµÄ×Ö·û´®±àÂëÎÊÌâ
Ô­Îijö´¦:http://hi.baidu.com/yobin/blog/item/894158b575090dcb37d3ca07.html
------------------------------------------------------------------
×Ö·û´®±àÂë
pythonÖÐĬÈϱàÂëÊÇASCII£¬¿ÉÒÔͨ¹ýÒÔÏ·½Ê½ÉèÖúͻñÈ¡£º
import sys
print sys.getdefa ......

python os Ä£¿é

Python 3 ½Ì³Ì¶þ:Îļþ,Ŀ¼ºÍ·¾¶
http://www.cnitblog.com/yunshichen/archive/2009/04/01/55931.html
python osÄ£¿é
http://hi.baidu.com/happynp/blog/item/729243f902d5a751242df2c2.html
http://hi.baidu.com/fiber212121/blog/item/6e07ec03c97b6982d53f7c27.html
python getoptÄ£¿é
http://www.tsnc.edu.cn/de ......

Python ¿½±´¶ÔÏó£¨É±´deepcopyÓëdz¿½±´copy£©

>>> import copy
>>> a = [1,2,3,4,['a','v']]
>>> b = a
>>> b
[1, 2, 3, 4, ['a', 'v']]
>>> c = copy.copy(a)
>>> c
[1, 2, 3, 4, ['a', 'v']]
>>> d = copy.deepcopy(a)
>>> d
[1, 2, 3, 4, ['a', 'v']]
>>> a.append(5) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ