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

×î¼òµ¥µÄ 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()


Ïà¹ØÎĵµ£º

Python3ÔÚubuntu»·¾³Ïµİ²×°

       Ê×ÏÈÏÂÔØ×îа汾µÄPython£¬ÔÚÕâÀïÎҵİ汾ÊÇPython3.1.1¡£È»ºó¾ÍÊǰ²×°£¬Çл»µ½PythonµÄÎļþĿ¼Ï£º
./configure
make
make test
sudo make install
      ÔÚÕâÀï¿ÉÄÜ»áÓöµ½¼¸¸öÎÊÌ⣬µÚÒ»¸öÊÇÔÚ./configureʱ£¬¿ÉÄÜ»á³öÏÖC compiler cannot create ......

[ת] ×î¼òµ¥µÄʹÓÃUDPͨÐŵÄPython SocketÀý×Ó

À´Ô´£ºhttp://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
¿Í»§¶Ë³ÌÐò´úÂ룺
# Client program
from socket import *
# Set the socket parameters
host = "localhost"
port = 21567
buf = 1024
addr = (host,port)
# Create socket
UDPSock = socket(AF_INET,SOCK_DGRAM) ......

Pythonѧϰ×ÊÁÏ


Pythonѧϰ
 
»ù±¾ÄÚÈÝ
Python»ù±¾°²×°£º
http://www.python.org/ ¹Ù·½±ê×¼Python¿ª·¢°üºÍÖ§³Ö»·¾³£¬Í¬Ê±Ò²ÊÇPythonµÄ¹Ù·½ÍøÕ¾£»
http://www.activestate.com/ ¼¯³É¶à¸öÓÐÓòå¼þµÄÇ¿´ó·Ç¹Ù·½°æ±¾£¬ÌرðÊÇÕë¶ÔWindows»·¾³Óв»ÉٸĽø£»
 
PythonÎĵµ£º
http://www.python.org/doc/current/lib/ ......

PythonÊý¾Ý½á¹¹Ö®——list

     PythonÖÐÓÐËÄÖÖÄÚ½¨µÄÊý¾Ý½á¹¹£ºList£¬Tuple£¬Dictionary£¬Set¡£±¾ÎÄÖ÷Òª½éÉÜList¡£
     ListÊÇÓÃÀ´´æ·ÅÒ»×é¶ÔÏóÐòÁС£¿ÉÒÔÏñlistÖÐÌí¼ÓÔªËØ¡¢É¾³ýÔªËØ£¬Í¬Ê±Ò²¿ÉÒÔÏñ·ÃÎÊÊý×éÒ»Ñù·ÃÎÊlist¡£ListÊǿɱäµÄÊý¾ÝÀàÐÍ¡£
    ÏÂÃæ£¬¸ø³öÒ»×élistµÄÊ¹Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ