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

³õѧPython£¬ÓÃEclipse+pydev£¬µ÷ÊÔʱÔõô´«Èë²ÎÊý

ÈçÌ⣬ÎÒµÄÖ÷º¯ÊýÊÇ´«Èë²ÎÊýµÄ£¬Æ½Ê±ÔËÐÐʱÊÇÓÃÃüÁîÐд«Èë²ÎÊýÔËÐУ¬ÏÖÔÚÏëµ÷ÊÔ£¬²»ÖªµÀÔõô´«½øÕâ¸öÃüÁîÐеIJÎÊý
¿´ Run ²Ëµ¥ÖÐµÄ Open run Dialog... ÀïÃæÓУ¬Ï¸ÐÄ¿´Ò»ÏÂ

ûÓÐÕâÒ»Ïî°¡

sys.argv.append("...")

È»ºóÖ±½ÓÔËÐÐ...

run -> run configuration ->

×ó²àÑ¡Ôñpython run Ë«»÷, ÓÒ²à»áн¨Ò»¸örunµÄÅäÖÃ, ×îÉÏÃæµÄnameÊÇÄãÕâ¸örunÅäÖõÄÃû×Ö, ËæÒâд. 
ÏÂÃæÖ÷ÒªµÄÑ¡ÏÓÐ:
Main: ÅäÖÃÖ÷³ÌÐòÏà¹Ø
  project: Ñ¡ÔñÄãµÄÏîÄ¿
  main model: Ñ¡ÔñÄãµÄÈë¿ÚÄ£¿é
Arguments: ÅäÖÃÆô¶¯²ÎÊý
  program arguments: ÕâÀïÌîдÄãµÄ³ÌÐò²ÎÊý
  vm arguments: Ìîдpython½âÊÍÆ÷²ÎÊý
Interpreter: ÅäÖÃpython½âÊÍÆ÷

Â¥ÉϺܺÃ


Ïà¹ØÎÊ´ð£º

python Òì³£Í˳ö

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

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

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

pythonÖÐÏß³ÌÎÊÌ⣿£¿

ÎÒÏÖÔÚÊÇÕâÑùµÄ
¿ªÁËÒ»¸ö×ÓỊ̈߳¬¶ÁÈ¡ÏÂÃæµÄÏûÏ¢
±¾ÒâÊÇ
Python code:

while not self._stopevent.isSet( ):
re=¶ÁȡϲãÏûÏ¢
if re>0:
´¦Àí
else:
pass

¼ÙÈ ......

pythonµÄÒýÓüÆÊý

ÎÒÓÃÁËdef CreateMyDialog(self):
        dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......

IIS 7 python 2.6 cgi ÎļþÉÏ´«ÎÊÌâ

ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......

python ÅÀÈ¡ÍøÒ³ÊdzöÏֵĴíÎó

´úÂë:
    timeout = 10
    socket.setdefaulttimeout(timeout)
    sock = urllib2.urlopen(url)
    html = sock.read()
Ò»°ãÇé¿öÄÜÐУ¬ÔËÐÐûÎÊÌ⣠......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ