Python 3 鏁欑▼

python3

Python镄?.0鐗堟湰锛屽父琚О涓篜ython 3000锛屾垨绠€绉癙y3k銆傜浉瀵逛簬Python镄勬棭链熺増链紝杩欐槸涓€涓缉澶х殑鍗囩骇銆备负浜嗕笉甯﹀叆杩囧镄勭疮璧桡紝Python 3.0鍦ㄨ璁$殑镞跺€欐病链夎€冭槛鍚戜笅鍏煎銆?/p>

Python 浠嬬粛鍙婂畨瑁呮暀绋嬫垜浠湪Python 2.X鐗堟湰镄勬暀绋?/a>涓凡链変粙缁嶏紝杩欓噷灏变笉鍐嶈禈杩般€?a/>

浣犱篃鍙互镣瑰向 Python2.x涓?钬嬧€?x鐗堟湰鍖哄埆 鏉ユ煡鐪嬩袱钥呯殑涓嶅悓銆?/p>

链暀绋嬩富瑕侀拡瀵笔ython 3.x鐗堟湰镄勫涔狅紝濡傛灉浣犱娇鐢ㄧ殑鏄疨ython 2.x鐗堟湰璇风Щ姝ヨ呖Python 2.X鐗堟湰镄勬暀绋?/a>銆?


镆ョ湅python鐗堟湰

鎴戜滑鍙互浣跨敤浠ヤ笅锻戒护鏉ユ煡鐪嬫垜浠娇鐢ㄧ殑Python鐗堟湰锛?/p>

python -V

浠ヤ笂锻戒护镓ц缁撴灉濡备笅锛?/p>

Python 3.3.2

浣犱篃鍙互杩涘叆Python镄勪氦浜掑纺缂栫▼妯″纺锛屾煡鐪嬬増链细

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 

绗竴涓狿ython3.x绋嫔簭

瀵逛簬澶у鏁扮▼搴忚瑷€锛岀涓€涓叆闂ㄧ紪绋嬩唬镰佷究鏄?Hello World锛?锛屼互涓嬩唬镰佷负浣跨敤Python杈揿嚭"Hello World锛?锛?/p>

瀹炰緥(Python 3.0+)

#!/usr/bin/python3 print("Hello, World!");

浣犲彲浠ュ皢浠ヤ笂浠g爜淇濆瓨鍦╤ello.py鏂囦欢涓苟浣跨敤python锻戒护镓ц璇ヨ剼链枃浠躲€?/p>

$ python3 hello.py

浠ヤ笂锻戒护杈揿嚭缁撴灉涓猴细

Hello, World!