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

ÓÃpythonдµÄÊý¾Ýת·¢³ÌÐò

#coding:utf-8
import socket,time,sys
def proxy_server():
    client_addr = 0
    conn = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
    conn.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
    conn_addr = ('192.168.0.10',9999)           
    conn.bind(('',2222))                   
    while 1:
        print "Start the proxy.........."
        datas,addr = conn.recvfrom(1024)
        if not addr[0] == '192.168.0.10':
            try:
                conn.sendto(datas,conn_addr)
                client_addr = addr
            except:
                print "s"
        else:
            conn.sendto(datas,client_addr)

ÒÔÉÏ´úÂëÖ÷ҪʵÏÖÔÚ¾ÖÓòÍøÄÚA¿Í»§¶Ë·¢¸ø±¾»ú¶Ë¿Ú2222µÄudp°üת·¢¸ø192.168.0.10:9999£¬ËùÓÐ192.168.0.10:9999·¢ËÍ»ØÀ´µÄÊý¾Ý°üÔÙת·¢¸øA¿Í»§¶Ë£»
Ϊʲôֻ»áÖ´ÐÐ4Ìõ¡°Start the proxy..........¡±£¿²»»áһֱѭ»·µÄÂð£¿ÄÇdatasÖ»ÊÇÆðÒ»¸ö»º³å³ØµÄ×÷ÓÃÂð£¿Èç¹ûÎÒÒªÈÃda


Ïà¹ØÎÊ´ð£º

python Òì³£Í˳ö

×î½üÓÃpythonдһ¸ö³ÌÐò,×ÜÊÇÒì³£Í˳ö£¬µ«ÊÇȴû·¨ÓÃtry..exceptÀ´²¶×½

ÓÉÓÚû·¨·¢Í¼Æ¬£¬ËùÒÔ°ÑÏà¹ØµÄÐÅÏ¢´òÓ¡³öÀ´
Òì³£µÄÐÅÏ¢´óÖÂÈçÏ£º

python.exeÓöµ½ÎÊÌâÐèÒª¹Ø±Õ¡£ÎÒÃǶԴËÒýÆðµÄ²»±ã±íʾ±§Ç¸ ......

Ë­ÍƼöÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл

Ë­ÍƼöÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл
¡¶python¼òÃ÷½Ì³Ì¡·£¬¡¶pythonºËÐıà³Ì¡·

×÷Ϊϵͳ¹ÜÀí·½Ã棬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3/255142.jpg

ÒýÓÃ
×÷Î ......

python listÖÐÌí¼ÓÀà¶ÔÏóµÄÎÊÌâ

ÔÚlistÖÐÌí¼ÓÒ»¸öÀàµÄ¾Ö²¿±äÁ¿ ÕâÑù×öÊÇ·ñºÏ·¨ Çë¿´ÏÂÃæÀý×Ó:
Python code:

class A():
def __init__( self ):
self.__a = 0
self.__b = 'hello'
def get_a( self ):
ret ......

python urllib urllib2 httplib ·ÃÎÊurlµÄÎÊÌâ

ÎÒÏëÓÃpython½âÎöÍøÒ³ÖеÄurl ÔÚÏÂÔØ֮ǰ, ÎÒÏëÏÈ·¢Ò»¸öheadÇëÇó ²»ÐèÒªÏÂÔØÕû¸öÍøÒ³, ÏÈ»ñµÃ¸ÃÍøÕ¾µÄheadÐÅÏ¢, ¶ÁȡһЩÐÅÏ¢Ö®ºó ÔÚµ÷ÓÃÕâЩ¿âµÄread·½·¨À´¶ÁÈ¡Õû¸öÍøÒ³ ¸ÃÔõô²Ù×÷ÄØ ¶àл
°ï¶¥ÁË

ÓÐÈËÄÜÖ¸½ÌÒ» ......

¶®pythonµÄjava¸ßÊÖÇë½Ì - Java / Java SE

ÇëÎʸßÊÖ£¬pythonÀïµÄpopenÀàËÆjavaÀïµÄÄĸöÀà»òÕß·½·¨ÄØ£¿£¿ÁíÍâjython¿ª·¢java¸ÃÈçºÎʹÓÃjythonÄØ£¿£¿
1.¿ÉÄܺÍjavaÀïµÄRuntime.getRuntime().exec£¨"ϵͳÃüÁî"£©; Æô¶¯½ø³Ì
2.eclipseÏÂÔØjython ²å¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ