python 학습(1)-기초 지식

2455 단어 python
만물 이 모두 대상 이다.
Pyhon 에 서 는 모든 것 이 대상 이 고 거의 모든 것 이 속성 과 방법 이 있 습 니 다.
모든 것 을 변수 에 할당 할 수 있 습 니 다.
혹은
매개 변수 로 함수 에 전달 합 니 다.
http://www.python.org/doc/current/ref/
(http://www.python.org/doc/current/ref/objects.html
(http://www.effbot.org/guides/
(http://www.effbot.org/guides/python-objects.htm
--------------------------------------------------------------------------------------------------------------------------------
테스트 모듈
모듈 식 대상,유name__속성
import 이 모듈 을 가 져 올 때,name__모듈 이름 입 니 다.접미사 같은 건 없습니다.
이 모듈 을 표준 프로그램 처럼 실행 할 때name__바로 결 성 치main__。
이렇게 해서 하나의 체 제 를 제공 하고 이 특징 을 이용 하여 테스트 를 한다.
if __name__ == "__main__":
	myParams = {"server":"mpilgrim", \
				"database":"master", \
				"uid":"sa", \
				"pwd":"secret"
				}
	print buildConnectionString(myParams)
>>> import odbchelper
>>> odbchelper.__name__
'odbchelper'

Python Reference Manualhttp://www.python.org/doc/current/ref/에서 가 져 오기 모듈 에 대해 논 의 했 습 니 다. 의 밑바닥 디 테 일.
 ( http://www.python.org/doc/current/ref/import.html ) -----------------------------------------------------------------------------------------------------
구문 과 구문 블록 분할
Python 은 코드 블록 을 분할 하기 위해 하 드 리 턴 을 사용 합 니 다.
Python Reference Manual (http://www.python.org/doc/current/ref/)교차 축 진 문 제 를 토론 하고 여러 가지 오 류 를 보 여 주 었 습 니 다.http://www.python.org/doc/current/ref/indentation.htmlPython Style Guidehttp://www.python.org/doc/essays/styleguide.html는 좋 은 들 여 쓰기 스타일 을 토론 했다.
-------------------------------------------------------------------------------------------------------------

좋은 웹페이지 즐겨찾기