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는 좋 은 들 여 쓰기 스타일 을 토론 했다.
-------------------------------------------------------------------------------------------------------------
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
로마 숫자를 정수로 또는 그 반대로 변환그 중 하나는 로마 숫자를 정수로 변환하는 함수를 만드는 것이었고 두 번째는 그 반대를 수행하는 함수를 만드는 것이었습니다. 문자만 포함합니다'I', 'V', 'X', 'L', 'C', 'D', 'M' ; 문자열이 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.