U E D R , A S I H C RSS

캠이랑놀자/051228

/051228



Python - hand-on python

~python
>>> x=10
>>> print x
10
>>> x=20
>>> print x
20
~python
>>> 20+30
50
>>> s=_
>>> s
50

range, for-in
~python
>>> range(10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> range(3,6)
[3,4,5]
>>> for i in range(5):
...           print i
1
2
3
4
5

for-in, list
~python
>>> s=[1,2,3,4]
>>> for i in s:
...         print i
1
2
3
4


~python
if x==0:
    print x
else:
    print x+10


~python
def fact(n):
     if n==0: return 1
     return n*fact(n-1)

Python Image Processing

Using PIL

~cpp
import Image
im = Image.open("lena.gif")
im.size

whitening

~cpp
import Image
im = Image.open("lena.gif")
for x in range(256):
         for y in range(256):
                 im.putpixel((x,y), im.getpixel ((x,y)) + 30 )
im.show()

darkening

~cpp
import Image
im = Image.open("lena.gif")
for x in range(256):
         for y in range(256):
                 im.putpixel((x,y), im.getpixel ((x,y)) - 30 )
im.show()

mirror


overlap (blending)


, . PIL 핑 하 Python + PIL 행.

1 hand-out python matlab . .

, hand-out + . --1002

----
hand-out ? ? --JuNe
hand-out ~? (hand-on ;) 확히 행했, , , , 행했. , 한 힌트 . --1002
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:17
Processing time 0.0277 sec