比思論壇

標題: Python 命令行 [打印本頁]

作者: hncszz    時間: 2020-12-6 15:42
標題: Python 命令行
要在 python 中测试少量代码,在文件中写代码有时不是最快最简单的。把 Python 作为命令行来运行是可能的。
在 Windows、Mac 或 Linux 命令行上键入以下内容:
C:\Users\Your Name>python在此,您可以编写任何 python,包括本教程前面的 hello world 例子:
C:\Users\Your Name>pythonPython 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> print("Hello, World!")这将在命令行中输出 "Hello, World!":
C:\Users\Your Name>pythonPython 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> print("Hello, World!")Hello, World!





歡迎光臨 比思論壇 (http://108.170.10.236/) Powered by Discuz! X2.5