Graphic n Game
2012 Python Study for Artist....
혁쓰다스토리
2012. 1. 10. 15:49
흠.... 파이썬을 공부하면 좋다는 말은 종종 들었던 바.... 그러던 중
파이썬을 공부하면 좋은 이유.. 2008년 GDC 내용.... 일단 참고...
1. Python이 뭐야?
컴퓨터 언어다.... 컴파일이 필요없는 인터프리터 언어...바로 결과를 볼 수 있다능..
비교적 다른 언어보다 배우기 쉽다.. 임베디드가 편하다..라고 어디서 들었다. ㅎㅎ
2. Python을 Artist가 알아두면 얻게 되는 이득....
ㄱ. 잡다한 단순하고 반복적인 작업을 컴퓨터에게 맡길 수 있다..
ㄴ. 한번 잘 만들어 놓으면 지원되는 다른 어플리케이션에서 써먹기 쉽다. (마야 기본지원...맥스나 포토샵등은 플러긴 형태로 지원...)
ㄷ. Unity3D와 같은 게임엔진에서도 Python을 지원한다고 한다... 어떻게 이용해 먹을지는 모르지만.... 사방팔방에서 여러용도로 쓰이고 있다.
3. 좋아!!! Python을 설치하자.
ㄱ. 일단 http://python.org/download/ 에서 파이썬을 다운로드한다......
근데 2.x와 3.x가 있다능.... 맨 처음에 뭘 받아야 하는지를 몰라서 헤메고 있었다.. 알아보니 제작자가 2.x를 만들고 한번 뒤집어 엎어서 나온 것이 3.x ...
근데 2.x 도 포기할 수가 없는 상황이었다 라나 뭐라나...그래서 두 버전 모두 현재 진행형....
어쨌든 2.x가 유저층이 많다고 하고 실제로 그래픽영역에서도 2.x 버전이 많이 쓰이는 듯....
게다가 버전 업이 될수록 결국 3.x로 통합된다고 하니..
계속 쓰다보면 뭐 3.x로 자연스레 가게 될 듯... (현재는 3.x와 2.x가 호환이 되지 않는다....)
기억하기로는 제작자가 크리스마스 때 할 일 없어서 만들었다고 하는데... 뭔 오덕 외계인인가... 싶음... 아님 말고....;;;;;
ㄴ. IDE(Integrated Development Environment)를 설치하자... 일단 이클립스...http://www.eclipse.org/downloads/
이클립스는 윈도우 리눅스 맥 플랫폼에서 모두 사용 가능...
실행하면 Workspace를 정하라고 나온다....원하는 곳에 설치...
일단 실행이 되면 Help > Install New Software > Add > Name에는 PyDev라고 쓰고 Location에는 http://pydev.org/updates/ 적은 후
업데이트를 받는다.
그리고 Window > Preferences > PyDev 트리를 펼친 후 > Interpreters > New > 미리 설치한 python.exe 경로를 찍어준다.
Src 폴더를 선택해 마우스 오른쪽 버튼을 누르고 New > PyDev Module 메뉴를 선택하고 적당한 이름을 적은 후 Finish
하면 코드가 입력되기를 기다리고 있는 상태가 된다.
윙 IDE는 더 간단하다.....Wing101이 무료이고 나머지는 다 유료인 듯..... 받아서 깔면 바로 py파일을 만들 수 있는 창을 손쉽게 띄울 수 있다...
-------------------------------------------------------------------------------------------------------------------------------------
기본 개념 간단 예.. 책에서 퍼 옴....(Python and Tkinter Programming, 인포북)
# 리스트형 자료구조 멤버 순환하기 예제..
if 'jeg' in [ 'abc', 'tuv', 'kie', 'jeg']:
...
if '*' in '123*abc':
...
# 멤버를 직접 수정할 수 있다.
lst = [1, 2, 4, 5, 9]
lst[3] = 10
print lst
# 투플 만들고 수정하기 ....투플을 변경한 게 아니고, 새로 만들어서 a에 할당한 것
# 파이썬 예제......또는 예제로 볼만한 것?
1. Python Script: Point Cloud Skinner 로 볼만한
http://www.blendernation.com/2012/01/12/python-script-point-cloud-skinner/#utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Blendernation+%28BlenderNation%29
-------------------------------------------------------------------------------------------------------------------------------------
etc. 가볼만한 곳.... 링크...
http://tech-artists.org/forum/
New/Learning Python
Official Python site - Great place to start
Python.org Online Documentation
Official Python tutorial
Dive Into Python - Excellent site/book for novice Python users
Python Extensions
Python Package Index - AKA the Cheese Shop. Large list of extension packages available for Python
Python Win32 - Definitive extensions for working with Windows
wxPython - Popular choice for developing GUIs.
Python Imaging Library (PIL) - For working with images, texture files
SQLAlchemy - Excellent SQL database toolkit
PyExcelerator - Great for working with MS Excel documents
Pygame - Game framework for Python
Py2exe - Compile Python scripts into EXEs
Twisted - Event-driven networking engine
Books
Learning Python, 3rd Ed., Mark Lutz
Python Programming for the Absolute Beginner, Michael Dawson
Python Programming in Win32, Mark Hammond, Andy Robinson
Programming Python, 3rd Ed., Mark Lutz
Beginning Python: From Novice to Professional, Magnus Lie Hetland
Python Tools
Wing IDE - Excellent Python IDE with full debugger and remote debugging ability
SWIG - "Glue code" generator for binding Python to C and C++
Boost.Python - Another glue code option.
http://www.volition-inc.com/gdc/GDC2...echArtists.ppt
http://www.volition-inc.com/gdc/GDC2008_AdamPletcher_PythonSamples.zip
IronPython - Very useful if you do much work with FX Composer 2.x
Python for .NET (or just Python .NET) - A good way to get .NET support into Maya and Motionbuilder
http://www.coderholic.com/free-pytho...ramming-books/ has a listing of free e-books for python. They range from python 2.3 -2.5. They might be a little out of date but they're still pretty good. Well some of them, not all.
파이썬을 공부하면 좋은 이유.. 2008년 GDC 내용.... 일단 참고...
1. Python이 뭐야?
컴퓨터 언어다.... 컴파일이 필요없는 인터프리터 언어...바로 결과를 볼 수 있다능..
비교적 다른 언어보다 배우기 쉽다.. 임베디드가 편하다..라고 어디서 들었다. ㅎㅎ
2. Python을 Artist가 알아두면 얻게 되는 이득....
ㄱ. 잡다한 단순하고 반복적인 작업을 컴퓨터에게 맡길 수 있다..
ㄴ. 한번 잘 만들어 놓으면 지원되는 다른 어플리케이션에서 써먹기 쉽다. (마야 기본지원...맥스나 포토샵등은 플러긴 형태로 지원...)
ㄷ. Unity3D와 같은 게임엔진에서도 Python을 지원한다고 한다... 어떻게 이용해 먹을지는 모르지만.... 사방팔방에서 여러용도로 쓰이고 있다.
3. 좋아!!! Python을 설치하자.
ㄱ. 일단 http://python.org/download/ 에서 파이썬을 다운로드한다......
근데 2.x와 3.x가 있다능.... 맨 처음에 뭘 받아야 하는지를 몰라서 헤메고 있었다.. 알아보니 제작자가 2.x를 만들고 한번 뒤집어 엎어서 나온 것이 3.x ...
근데 2.x 도 포기할 수가 없는 상황이었다 라나 뭐라나...그래서 두 버전 모두 현재 진행형....
어쨌든 2.x가 유저층이 많다고 하고 실제로 그래픽영역에서도 2.x 버전이 많이 쓰이는 듯....
게다가 버전 업이 될수록 결국 3.x로 통합된다고 하니..
계속 쓰다보면 뭐 3.x로 자연스레 가게 될 듯... (현재는 3.x와 2.x가 호환이 되지 않는다....)
기억하기로는 제작자가 크리스마스 때 할 일 없어서 만들었다고 하는데... 뭔 오덕 외계인인가... 싶음... 아님 말고....;;;;;
ㄴ. IDE(Integrated Development Environment)를 설치하자... 일단 이클립스...http://www.eclipse.org/downloads/
이클립스는 윈도우 리눅스 맥 플랫폼에서 모두 사용 가능...
실행하면 Workspace를 정하라고 나온다....원하는 곳에 설치...
일단 실행이 되면 Help > Install New Software > Add > Name에는 PyDev라고 쓰고 Location에는 http://pydev.org/updates/ 적은 후
업데이트를 받는다.
그리고 Window > Preferences > PyDev 트리를 펼친 후 > Interpreters > New > 미리 설치한 python.exe 경로를 찍어준다.
Src 폴더를 선택해 마우스 오른쪽 버튼을 누르고 New > PyDev Module 메뉴를 선택하고 적당한 이름을 적은 후 Finish
하면 코드가 입력되기를 기다리고 있는 상태가 된다.
윙 IDE는 더 간단하다.....Wing101이 무료이고 나머지는 다 유료인 듯..... 받아서 깔면 바로 py파일을 만들 수 있는 창을 손쉽게 띄울 수 있다...
-------------------------------------------------------------------------------------------------------------------------------------
기본 개념 간단 예.. 책에서 퍼 옴....(Python and Tkinter Programming, 인포북)
# 리스트형 자료구조 멤버 순환하기 예제..
lst = ['first', 'second', 'third']
for str in lst:
print 'this entry is %s' % str
set = [ (1, 'uno'), (2, 'due'), (3, 'tres')]
for integer, str in set:
print 'numero "%d" in Italiano: e "%s" ' % (integer, str)
# 정렬과 순서 뒤집기...sort와 reverse라는 메소드를 지원한다.
# 멤버가 들어있는지 확인하기 쉽다.# 정렬과 순서 뒤집기...sort와 reverse라는 메소드를 지원한다.
lst = [4, 5, 1, 9, 2]
lst.sort()
print lst
lst.reverse()
print lst
if 'jeg' in [ 'abc', 'tuv', 'kie', 'jeg']:
...
if '*' in '123*abc':
...
# 멤버를 직접 수정할 수 있다.
lst = [1, 2, 4, 5, 9]
lst[3] = 10
print lst
# 투플 만들고 수정하기 ....투플을 변경한 게 아니고, 새로 만들어서 a에 할당한 것
a = 1, 2, 3
a = a[0], a[1], 10, a[2]
print(a)
# 딕셔너리
dict = {}
# 현재 쓰이는 방법
value = dict.get('a', None)
# Gui Tkinter 예제...
------------------------------------------------------------------------------------------------------------------------------------- # 딕셔너리
dict = {}
dict = {'a':1, 'b':2, 'c':3}
dict = {1: 'a', 2: 'b', 3: 'c'}
dict = {1:[1,2,3], 2:[4,5,6]}
# 딕셔너리 수정하기
dict['a'] = 10
dict[10] = 'Hyukx'
# 딕셔너리에 접근하기....일단 예전에 쓰이는 법...
if dict.has_key('a'):
value = dict['a']
else:
value = None
# 또는,
try:
try:
value = dict['a']
except KeyError:
value = None
# 현재 쓰이는 방법
value = dict.get('a', None)
# Gui Tkinter 예제...
from Tkinter import Label, mainloop
Label (text = 'This has to be the\nsimplest bit of code').pack()
mainloop() # 파이썬 예제......또는 예제로 볼만한 것?
1. Python Script: Point Cloud Skinner 로 볼만한
http://www.blendernation.com/2012/01/12/python-script-point-cloud-skinner/#utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Blendernation+%28BlenderNation%29
-------------------------------------------------------------------------------------------------------------------------------------
etc. 가볼만한 곳.... 링크...
http://tech-artists.org/forum/
New/Learning Python
Official Python site - Great place to start
Python.org Online Documentation
Official Python tutorial
Dive Into Python - Excellent site/book for novice Python users
Python Extensions
Python Package Index - AKA the Cheese Shop. Large list of extension packages available for Python
Python Win32 - Definitive extensions for working with Windows
wxPython - Popular choice for developing GUIs.
Python Imaging Library (PIL) - For working with images, texture files
SQLAlchemy - Excellent SQL database toolkit
PyExcelerator - Great for working with MS Excel documents
Pygame - Game framework for Python
Py2exe - Compile Python scripts into EXEs
Twisted - Event-driven networking engine
Books
Learning Python, 3rd Ed., Mark Lutz
Python Programming for the Absolute Beginner, Michael Dawson
Python Programming in Win32, Mark Hammond, Andy Robinson
Programming Python, 3rd Ed., Mark Lutz
Beginning Python: From Novice to Professional, Magnus Lie Hetland
Python Tools
Wing IDE - Excellent Python IDE with full debugger and remote debugging ability
SWIG - "Glue code" generator for binding Python to C and C++
Boost.Python - Another glue code option.
http://www.volition-inc.com/gdc/GDC2...echArtists.ppt
http://www.volition-inc.com/gdc/GDC2008_AdamPletcher_PythonSamples.zip
IronPython - Very useful if you do much work with FX Composer 2.x
Python for .NET (or just Python .NET) - A good way to get .NET support into Maya and Motionbuilder
http://www.coderholic.com/free-pytho...ramming-books/ has a listing of free e-books for python. They range from python 2.3 -2.5. They might be a little out of date but they're still pretty good. Well some of them, not all.