我们可以使用以下命令来查看我们使用的Python版本:
python -V |
以上命令执行结果如下:
Python 3.3.2 |
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. |
>>> |
对于大多数程序语言,第一个入门编程代码便是"Hello World!",以下代码为使用Python输出"Hello World!":
#!/usr/bin/python |
print("Hello, World!"); |
$ python3 hello.py |