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

PythonΪÀඨÒå¡°¿½±´¹¹Ô캯Êý¡±

³õѧPython£¬Õâô×öºÃÏñÓеã2£¬´ÕºÏÄÜÓãº
class MyClass():
def __init__(self, n = 10):
self._Field = n
def __getitem__(self, range):
return MyClass(self._Field)
obj1 = MyClass()
obj2 = obj1
obj3 = obj1[:]
obj1._Field = 100
obj4 = MyClass(123)
print obj1._Field, obj2._Field, obj3._Field, obj4._Field 
ʵ¼ÊÊä³öΪ£º
>>> 100 100 10 123


Ïà¹ØÎĵµ£º

python´¦ÀíXML

»ù±¾É϶¼ÊÇʹÓÃpythonÀ´½âÎöxmlÎļþµÄ¡£
±ÈÈçÎÒÒª½«ÄÚÈÝΪ
<?xml version="1.0" encoding="utf-8"?>
    <root>
        <book isbn="34909023">
            <author>
 &n ......

ÈçºÎÔÚApacheÏÂÉèÖÃPython(WIN,CGI·½·¨)

¹ØÓÚPython£¬±¾È˲»Ïë¶à˵ÁË£¬Èç¹û²»ÖªµÀʲôÊÇPython£¬¿ÉÒÔ¿´¡¶Ê²Ã´ÊÇPython
£¿¡·Ò»ÎÄ¡£Python¿ÉÒÔ¿ª·¢CGI³ÌÐò£¬ÄÇôÔÚApacheÏÂÓ¦ÈçºÎÅäÖÃÄØ£¿±¾ÎÄÖ»½²ÊöÁËÈçºÎ
ÒÔCGI·½Ê½ÅäÖÃApache£¬Ê¹ÆäÖ§³ÖPython³ÌÐò¡£ÆäËü·½Ê½£¬Èçmod_pythonÔò²»ÔÚÌÖÂÛ·¶Î§
(ÆäʵÊÇûÅä³É¹¦:-)¡£ÎÒËùʹÓõÄϵͳ»·¾³ÎªWindows 2000, Apache 1.3.19£ ......

Python ´¦Àíexcel²¢×ªÎªtable

ʹÓÃxlrd
À´
¶ÁÈ¡£¬xlrdµÄÏÂÔؼ°°²×°¿ÉÒԲο´:
Python
"xlrd" package for extracting data from Excel files
---------------------------------------------------------------------------------
#coding=utf-8
import xlrd
import os, types, datetime
#excel´æ·ÅĿ¼
dir = u'D:\\temp\\excel'
......

Python word


³¬Èº.comµÄ²©¿Í
Pythonת»»office wordÎļþΪHTML
ÕâÀï²âÊԵĻ·¾³ÊÇ£ºwindows xp,office 2007,python 2.5.2,pywin32 build
213£¬Ô­ÀíÊÇÀûÓÃwin32com½Ó¿ÚÖ±½Óµ÷ÓÃoffice
API£¬ºÃ´¦ÊǼòµ¥¡¢¼æÈÝÐԺã¬Ö»ÒªofficeÄÜ´¦ÀíµÄ£¬python¶¼¿ÉÒÔ´¦Àí£¬´¦Àí³öÀ´µÄ½á¹ûºÍoffice wordÀïÃæ“Áí´æΪ”Ò»Ö¡£
#!/usr/bin/en ......

ʹÓÃCÓïÑÔÀ©Õ¹Python£¨Ò»£©

¿ª·¢»·¾³£ºUbuntu9.10,python2.6,gcc4.4.11,ubuntuϵÄpythonÔËÐаüºÍ¿ª·¢°üÊÇ·Ö¿ªµÄ£¬Òò´ËÐèÒªÔÚÐÂÀûµÃÀïÃæ°²×°python-all-dev,´Ó¶ø¿ÉÒÔÔÚ´úÂëÖÐÒýÓÃpythonµÄÍ·ÎļþºÍ¿â¡£2.ÏÂÃæÊÇÒ»¸ö×î¼òµ¥µÄ¿ÉÒÔ¹©pythonµ÷ÓõÄcÀ©Õ¹Ä£¿é£¬¼ÙÉèc³ÌÐòÎļþÃûΪfoo.c:´úÂë#include <Python.h>
static PyObject* foo_b ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ