³õѧ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дһ¸ö³ÌÐò,×ÜÊÇÒì³£Í˳ö£¬µ«ÊÇȴû·¨ÓÃtry..exceptÀ´²¶×½
ÓÉÓÚû·¨·¢Í¼Æ¬£¬ËùÒÔ°ÑÏà¹ØµÄÐÅÏ¢´òÓ¡³öÀ´
Òì³£µÄÐÅÏ¢´óÖÂÈçÏ£º
python.exeÓöµ½ÎÊÌâÐèÒª¹Ø±Õ¡£ÎÒÃǶԴËÒýÆðµÄ²»±ã±íʾ±§Ç¸ ......
ÎÒÏÖÔÚÊÇÕâÑùµÄ
¿ªÁËÒ»¸ö×ÓỊ̈߳¬¶ÁÈ¡ÏÂÃæµÄÏûÏ¢
±¾ÒâÊÇ
Python code:
while not self._stopevent.isSet( ):
re=¶ÁȡϲãÏûÏ¢
if re>0:
´¦Àí
else:
pass
¼ÙÈ ......
ÎÒÓÃÁËdef CreateMyDialog(self):
dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......
ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......
´úÂë:
timeout = 10
socket.setdefaulttimeout(timeout)
sock = urllib2.urlopen(url)
html = sock.read()
Ò»°ãÇé¿öÄÜÐУ¬ÔËÐÐûÎÊÌ⣠......