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

PythonÈëÃŵÄ36¸öÀý×Ó——05 ´ÏÃ÷µÄ±äÁ¿

# 005
# ÔÚPythonÖиø±äÁ¿¸³ÖµÊ±²»ÐèÒªÉùÃ÷Êý¾ÝÀàÐÍ
i = 33
print i
# ¿ÉÒÔÕâÑù×öµÄÔ­ÒòÊÇPython°Ñ³ÌÐòÖÐÓöµ½µÄÈκζ«Î÷¶¼¿´³ÉÊǶÔÏó(Á¬intÒ²²»ÀýÍâ)
# ÕâÑù,ÔÚʹÓöÔÏóʱ,±àÒëÆ÷»á¸ù¾ÝÉÏÏÂÎĵĻ·¾³À´µ÷ÓöÔÏó×ÔÉíµÄ·½·¨Íê³ÉÒþʽµÄת»»
# ÄãÉõÖÁ¿ÉÒ԰ѳÌÐòд³ÉÕâÑù
print 3 * 'haha '
# µ«Èôд³ÉÕâÑù±àÒëÆ÷¾Í»á±¨´í(×¢Òâ3ºóÃæµÄµã)
# print 3. * 'haha'

output:
1
2
33
haha haha haha


Ïà¹ØÎĵµ£º

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 ¶à¼Ì³Ð(2)

from:  http://www.chinesepython.org/pythonfoundry/tut2.3/tmp/multiple.html
9.5.1 ¶à¼Ì³Ð Multiple Inheritance
Python supports a limited form of multiple inheritance as well. A class definition with multiple base classes looks as follows:
PythonͬÑùÓÐÏÞµÄÖ§³Ö¶à¼Ì³ÐÐÎʽ¡£¶à¼Ì³ÐµÄÀඨÒåÐÎÈçÏÂÀ ......

Python Ascii to bcd bcd to Ascii

ÔÚÍøÉÏËѲ»µ½¹ØÓÚ Ascii ºÍ bcd»¥Ïàת»¯µÄÎÄÕ£¬ÓÚÊÇ×Ô¼ºÐ´ÁËÒ»¸ö£¬ºÍ´ó¼Ò·ÖÏíÏ¡£
ûÓп¼Âǵ½Ð§ÂÊ£¬Äܹ»ÓÅ»¯µÄµØ·½Íû´ó¼ÒÌá³ö
"""
    AscII×Ö·ûת»»ÎªBCD×Ö·û
"""
def asc2bcd(inAsc, pad_L0_R1 = 0):
#È«²¿×ª»»Îª´óд£¬ÎªºóÃæµÄת»»Ìṩ·½±ã
    inAsc = inAsc.upper()
 &nb ......

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ºÅ