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

ѧϰ¡¶PythonÓïÑÔÈëÃÅ¡·µÚÎåÕ ģ¿é

Ä£¿éÕⶫÎ÷ºÃÏñûʲôºÃ½²µÄ£¬ÎÞ·ÇÊDZ£´æÒ»·ÝÎļþ£¬È»ºóÔÚÁíÒ»·ÝÎļþÖÐÓÃimport ºÍfrom ** import **(*)¾ÍÐÐÁË¡£
ÕâÒ»ÕÂÖ÷Òª½²µ½ÁËϸ½Ú£¬µ¼ÈëÄ£¿éPythonÀïÃæÊÇʲô´¦ÀíµÄ£¬import ºÍ from ** import **ÓÐʲô²»Ò»Ñù¡£»¹ÓоÍÊÇÔö¼ÓÁËreload()Õâ¸öº¯ÊýµÄʹÓÃ˵Ã÷¡£
ÒÔÇ°¿´µ½ÄÄÀï˵¾¡Á¿Ê¹ÓÃimport¶ø²»ÒªÊ¹ÓÃfrom ** import **£¬Ò»Ö±²»ÖªµÀÔ­Òò£¬ÔÚÕâÒ»ÕÂÀïÕÒµ½Á˴𰸡£Æäʵ¾ÍÊÇPythonµ¼ÈëÄ£¿éʱÒýÓú͸³ÖµµÄÇø±ð¡£ºóÃæµÄÄ£¿é³£¼ûÎÊÌâÒ²´ÓÕâÀïÕ¹¿ª¡£
Ä£¿éÉè¼Æ¹À¼ÆÊǺÜÓÐÄѶȵĶ«Î÷£¬¿ÉϧÕâÀï½²µÃÌ«ÉÙÁË£¬Ö»Ìá³öÁË4¸öÔ­Ôò£¬Ã»ÓÐʵ¼ÊµÄÀý×Ó¡£
ÏÂÒ»ÕµÄÀàÊǸö´óÍ·£¬ÒѾ­ÔÚ¿´ÁË¡£×÷ÕßÓÃÁ˲»ÉÙƪ·ùдÀà¡£


Ïà¹ØÎĵµ£º

python pyserial ´®¿Ú

ÓÃpythonдÁ˸ö×î¼òµ¥µÄ¶Á´®¿ÚµÄ³ÌÐò£¬ÒòΪ¹¤×÷Öо­³£ÐèÒª¶Á´®¿Ú
·Åԭʼ´úÂë
import serial
ser = serial.Serial('com3',baudrate=115200, bytesize=8,parity='N', stopbits=1,xonxoff=0, timeout=1)
while( True ):
    a = ser.read(100)
    print a
ÓÃÍêÐèÒªser.close()£¬·ñÔòÆäË ......

python ¶à¼Ì³Ð

 from: http://www.cnblogs.com/dahuzizyd/archive/2005/03/01/111006.html
pythonÖ§³ÖÃæÏò¶ÔÏóµÄ±à³Ì·ç¸ñ£¬ÕâÀïÖ÷Ҫ˵˵pythonÖеĶà¼Ì³Ð£º
ÏÂÃæµÄ´úÂëʹÓÃpython2.4£¬°²×°ºóʹÓÃidleµÄIDE¿ª·¢»·¾³£¨ËµÊÇIDE £¬±ÈÆðdelphi,VS.netµÈ¼òµ¥µÃÌ«¶àÁË)
´ÓFile-New²Ëµ¥½¨Á¢Ò»¸ö.pyÎļþ£¬Ð´ÏÂÃæµÄ´úÂ룺
class SuperCl ......

×î¼òµ¥µÄ python ¶àÏß³ÌʾÀý

import time,thread
def test(a,b):
for i in range(a,b):
       time.sleep(1)
       print i
def start():
thread.start_new_thread(test,(1,1001))
thread.start_new_thread(test,(1000,2001))
if __name__=='__main__':
start()
......

PythonÄ£¿éѧϰ

¡¡¡¡ÉÏ´Îѧϰ¹ýmarshalÄ£¿éÓÃÓÚÐòÁл¯ºÍ·´ÐòÁл¯£¬µ«marshalµÄ¹¦ÄܱȽϱ¡Èõ£¬Ö»Ö§³Ö²¿·ÖÄÚÖÃÊý¾ÝÀàÐ͵ÄÐòÁл¯/·´ÐòÁл¯£¬¶ÔÓÚÓû§×Ô¶¨ÒåµÄÀàÐ;ÍÎÞÄÜΪÁ¦£¬Í¬Ê±marshal²»Ö§³Ö×ÔÒýÓÃ(µÝ¹éÒýÓÃ)µÄ¶ÔÏóµÄÐòÁл¯¡£ËùÒÔÖ±½ÓʹÓÃmarshalÀ´ÐòÁл¯/·´ÐòÁл¯¿ÉÄܲ»ÊǺܷ½±ã¡£»¹ºÃ£¬python±ê×¼¿âÌṩÁ˹¦Äܸü¼ÓÇ¿´óÇÒ¸ü¼Ó°²È«µÄpickle ......

easy_installÈÃpythonµÄ°ü¹ÜÀí±äµÃeasy

PythonÖеÄeasy_install¹¤¾ßºÜºÃÓã¬ËüµÄ×÷ÓÃÀàËÆÓÚPhpÖеÄpear£¬»òÕßRubyÖеÄgem£¬»òÕßPerlÖеÄcpan¡£
Èç¹ûÏëʹÓÃeasy_install¹¤¾ß£¬¿ÉÒÔÖ±½Ó°²×°ez_setup.py
½Å±¾£¬ÔÙpython ez_setup.py£¨Ö®Ç°ÏÈÒª°²×°python£©£º
°²×°Íêºó£¬×îºÃÈ·±£easy_installËùÔÚĿ¼ÒѾ­±»¼Óµ½PATH»·¾³±äÁ¿Àï:
Windows: C:\Python25\Scripts
Li ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ