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

Python ÏÂÔØÍøÒ³µÄ¼¸ÖÖ·½·¨

×ܽáÏ£¬Python ÏÂÔØÍøÒ³µÄ¼¸ÖÖ·½·¨
1
 fd = urllib2.urlopen(url_link)
 data = fd.read()
 ÕâÊÇ×î¼ò½àµÄÒ»ÖÖ£¬µ±È»Ò²ÊÇGetµÄ·½·¨
2
ͨ¹ýGETµÄ·½·¨
def GetHtmlSource(url):
    try:
   
        htmSource = ''
       
        req = urllib2.Request(url)
      
        fd = urllib2.urlopen(req,"")
       
        while 1:
            data = fd.read(1024)
            if not len(data):
                break
           
            htmSource += data
        fd.close()
 
        del fd
        del req
       
        htmSource = htmSource.decode('cp936')
        htmSource = formatStr(htmSource)
        
        return htmSource
       
    except socket.error, err:
       
        str_err =  "%s" % err
        return ""
3
 Í¨¹ýGETµÄ·½·¨
def GetHtmlSource_Get(htmurl):
    htmSource = ""
   
    try:
       
     


Ïà¹ØÎĵµ£º

תÌû£ºPython2.6 Ï°²×° mysql (Windows xp)

ת×Ô£º
http://hi.baidu.com/feng2211/blog/item/8b86b6d9816a3f2710df9b79.html
ºÍ
http://i.19830102.com/archives/164
Python °æ±¾£º2.6
ÏÂÔصØÖ·£ºhttp://www.python.org/download/releases/2.6.1/
ÏÂÔØmsiÎļþ²¢°²×°
MySQLdb°æ±¾£º MySQL-python-1.2.2.win32-py2.6.exe
ÏÂÔصØÖ·£ºhttp://home.netimperia.com/ ......

pythonдµÄ½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z¸ñʽ

#½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z.py
#for folder all file do 7z
import os
import sys
import distutils.file_util
def ImportOkFile():
    if(os.path.isfile("D:\\Records\\½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z_record.txt")==False):
        f=open("D:\\Reco ......

¼ò»¯Python½âÊÍ»·¾³µÄ°²×°

ÎÊÌâÃèÊö
ÔÚC++ºÍPython»ìºÏ±à³ÌÖУ¬ÔÚÈí¼þ·¢²¼µÄʱºòÐèÒª½«pythonµÄ½âÊÍÆ÷´ò°üµ½°²×°³ÌÐòÖУ¬ÎªÁËÌá¸ßÓû§ÌåÑ飬ÎÒÃÇÐèÒªÈÃÓû§¸Ð¾õ²»µ½pythonµÄ°²×°£¬Èç¹ûÓû§ÒѾ­°²×°ÓÐpythonµÄ»·¾³£¬ÎÒÃÇÒ²Òª±£Ö¤²»Ó°ÏìÏÖÓеÄϵͳ¡£
½â¾ö·½°¸
ÔÚPython2.5ÒÔºó£¬pythonÖ§³Ö´ÓzipÎļþÖжÁÈ¡python½Å±¾Îļþ£¬Ö§³Ö¶ÁÈ¡py£¬pyc£¬pyo£¬²»Ö ......

³õʼ»¯º¯ÊýÖеÄÐ麯Êýµ÷Ó㨠C++ vs python £©

´úÂë+½á¹û£¬²»×ö½âÊÍ
µ±È»£¬¶ÔÓÚpythonûÓÐvirtual functionһ˵£¬¹À¼Æµ±×÷¶Ô±ÈÒ»¸öÀý×Ó¿´¿´°É¡£
#include <iostream>
using namespace std;
class base
{
public:
virtual void foo() { cout << "base" << endl; }
base() { foo() ;}
};
class derive: public base
{
pub ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ