프로그래밍/Python
Hello 예제 for Python
Scripter
2008. 2. 12. 12:04
컨솔에 문자 출력하는 python 구문은
print "문자열(스트링)"
이다. 여기서 개행문자 "\n"은 추가하지 않아도 된다.
(Jython의 문자 출력 구문도 위와 같다.)
소스 파일명: hello.py
------------------------------[소스 시작]
print "Hello, world!"
------------------------------[소스 끝]
실행> python hello.py
Hello, world!
* Jython으로 실행하는 경우:
실행> jython hello.py
Hello, world!
* IronPython으로 실행하는 경우:
실행> ipy hello.py
Hello, world!
print "문자열(스트링)"
이다. 여기서 개행문자 "\n"은 추가하지 않아도 된다.
(Jython의 문자 출력 구문도 위와 같다.)
소스 파일명: hello.py
------------------------------[소스 시작]
print "Hello, world!"
------------------------------[소스 끝]
실행> python hello.py
Hello, world!
* Jython으로 실행하는 경우:
실행> jython hello.py
Hello, world!
* IronPython으로 실행하는 경우:
실행> ipy hello.py
Hello, world!