×î¼òµ¥µÄ 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ÊÇÒ»Ãżòµ¥µÄÓïÑÔ¡£¶ÔÓÚÒ»¸öÎÊÌ⣬Ӧ¸ÃÖ»ÓÐÒ»¸ö½â¾ö·½·¨¡£ÔÚPythonÖУ¬ÓÐÈýÖÖÁ÷³Ì¿ØÖÆ·½·¨£ºif-else¡¢whileºÍfor¡£
Ê×ÏÈ£¬½éÉÜif-elseÌõ¼þÓï¾ä¡£ifÓï¾äÊÇÓÃÀ´¸ù¾Ý±í´ïʽµÄÕæ¼ÙÀ´ÓÐÑ¡ÔñµÄÖ´ÐÐÌØ¶¨µÄ³ÌÐò¿é£¬¿ØÖƳÌÐòµÄÁ ......
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from ftplib import FTP
from os import path
from optparse import OptionParser
from FtpDownload import spilt_cmd
import socket
import sys
'''
ÉÏ´«ÖÕ¶ËMRÎļþµ½·þÎñÆ÷
V1.0 zhai 2009-07-27
'''
def main():
&nbs ......
http://hi.baidu.com/guzhilei1986/blog/item/8969b4debe99e150ccbf1ae7.html
º¯Êý ÃèÊö
int(x [,base ]) ......
ÓÃ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()£¬·ñÔòÆäË ......
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ͬÑùÓÐÏÞµÄÖ§³Ö¶à¼Ì³ÐÐÎʽ¡£¶à¼Ì³ÐµÄÀඨÒåÐÎÈçÏÂÀ ......