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

python ·ÖÐÎ


´úÂëÈçÏ£º
#!/usr/bin/env python
# -*-coding:UTF-8-*-#
from common import *
import Image, ImageFilter, math, sys, os, random
def modifyImageObj(img, matrix) :
    width, height = img.size   
   
    for h in range(0, height) :       
        for w in range(0, width) :
            pixel = matrix[h][w]
            img.putpixel((w, h), pixel)
    return img
def initMatrix(h, w, v = (0, 0, 0)) :
    result = []
    for _h in range(0, h) :
        row = []
        for _w in range(0, w) :
            row.append(v)
        result.append(row)
    return result
size = (600, 600)
img = Image.new('RGB', size)
h, w = size
matrix = initMatrix(h, w, (0, 0, 0))
m = []
m.append([-0.04, 0, -0.19, -0.47, -0.12, 0.3, 0.25])
m.append([0.65, 0, 0, 0.56, 0.06, 1.56, 0.25])
m.append([0.41, 0.46, -0.39, 0.61, 0.46, 0.4, 0.25])
m.append([0.52, -0.35, 0.25, 0.74, -0.48, 0.38, 0.25])
n = 0
x, y, a, b, c, d, e, f, newx, newy = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
while n < 300000 :
    r = random.uniform(0, 1)
    if r <= m[0][6] :
        a=m[0][0]
        b=m[0][1]
        c=m[0][2]
        d=m[0][3]
        e=m[0][4]
        f=m[0][5]
    elif r <= m[0][6] + m[1][6] :
        a=m[1][0]
   &nb


Ïà¹ØÎĵµ£º

Google½«ÏÞÖÆPythonÓïÑÔµÄÓ¦Óà ¿ª·¢ÉçÇøÈÈÒé

Google½«ÏÞÖÆPythonÓïÑÔµÄÓ¦Óà ¿ª·¢ÉçÇøÈÈÒé
 
¸ÐлÂ̲ÝÐǿյÄͶµÝ
ÐÂÎÅÀ´Ô´:CSDN
Collin WinterÊÇPythonÉçÇøÒ»Î»ÆÄ¾ßÓ°ÏìÁ¦µÄ¿ª·¢Õߣ¬ËûÔøÊÇCPythonÏîÄ¿µÄºËÐÄ¿ª·¢ÕßÖ®Ò»¡¢Ò²ÔøÊÇUnladen Swallow£¨¼ûÎÄĩעÊÍ£©µÄºËÐÄ¿ª·¢Õߣ¬²ÎÓëÁ˺ܶàPythonÏîÄ¿µÄ¿ª·¢¡£½üÀ´´«ÎÅGoogle½«ÔÚÆäÐÂÏîÄ¿ÖÐÏÞÖÆPythonµÄʹÓã¬Îª´ËÓп ......

python os Ä£¿é

Python 3 ½Ì³Ì¶þ:Îļþ,Ŀ¼ºÍ·¾¶
http://www.cnitblog.com/yunshichen/archive/2009/04/01/55931.html
python osÄ£¿é
http://hi.baidu.com/happynp/blog/item/729243f902d5a751242df2c2.html
http://hi.baidu.com/fiber212121/blog/item/6e07ec03c97b6982d53f7c27.html
python getoptÄ£¿é
http://www.tsnc.edu.cn/de ......

pythonÖÐÀàÊôÐÔºÍÀàʵÀýµÄÊôÐÔµÄÇø±ð

ÒÔÏÂÄÚÈÝ×ªÔØ×Ôjavaeye.comµÄ×÷Õßbluecrystal
»·¾³ËµÃ÷£ºÒÔÏÂpython´úÂë¾ùÔÚpython2.5ÏÂͨ¹ý¡£
    ×î½ü¿´µ½Ò»Ð©ÈËÔÚÌÖÂÛpythonÖÐÀàÊôÐÔºÍÀàµÄʵÀýµÄÊôÐÔ£¬ÎÒÒ²À´Ì¸Ì¸ÎÒ¸öÈ˶ÔÕâ¸öÎÊÌâµÄ¿´·¨£¬¹©pyer²Î¿¼¡£
    Ê×ÏÈÎÒÃÇÀ´¼òµ¥µÄ¶¨ÒåÒ»¸öpythonµÄÀࣺ
Python´úÂë
# coding:  ......

pythonÄ£¿éÖ®MySQLdb: ÓÃpythonÁ¬½ÓmysqlÊý¾Ý¿â

mysqlÊÇÒ»¸öÓÅÐãµÄ¿ªÔ´Êý¾Ý¿â£¬ËüÏÖÔÚµÄÓ¦Ó÷dz£µÄ¹ã·º£¬Òò´ËºÜÓбØÒª¼òµ¥µÄ½éÉÜÒ»ÏÂÓÃpython²Ù×÷mysqlÊý¾Ý¿âµÄ·½·¨¡£python²Ù×÷Êý¾Ý¿âÐèÒª°²×°Ò»¸öµÚÈý·½µÄÄ£¿é£¬ÔÚhttp://mysql-python.sourceforge.net/
ÓÐÏÂÔØºÍÎĵµ¡£
    ÓÉÓÚpythonµÄÊý¾Ý¿âÄ£¿éÓÐרÃŵÄÊý¾Ý¿âÄ£¿éµÄ¹æ·¶£¬ËùÒÔ£¬Æäʵ²»¹ÜʹÓÃÄÄÖÖÊý¾ ......

Python ºÍ bash shell½Å±¾

×÷Ϊһ¸ö³õѧshellµÄ³ÌÐòÔ±À´Ëµ£¬Ê¹ÓÃshellµÄһЩÃüÁîµ÷Ó㬱ÈÈç¾Íд¼¸ÐУ¬×öһЩ×Ô¶¯»¯µÄ²Ù×÷£¬¼òµ¥ÓÖʵÓ㬵«ÊÇÉæ¼°Âß¼­¿ØÖƺÍ
×Ö·û´®´¦Àíʱ£¬¿´µ½ÄÇif/fi£¬case£¯esac……»¹ÓйÅÀë¹Å¹ÖµÄ²¼¶ûÅжυ…»¹Óи´ÔÓ¶øÓÖÃû×ÖºÜÏì¶øÇÒºÜÀÏ×ʸñµÄsed¡¢awk……ÎÒ¾ÍÏ룬
ÔÚûÓзÇÒªÔÚshellÖÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ