您的位置:首页 > 编程语言 > Python开发

【学习笔记】Python的 Hello world

2017-12-07 19:51 501 查看

Python 交互模式运行Hello world

cmd窗口输入 python,即可进入Python交互模式

python交互模式下输入:print(“hello world”)

显示结果:hello world

图示



具体运行

D:\PythonProject>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>>
>>>
>>> print("hello world")
hello world
>>>
>>>


cmd窗口运行.py文件

D盘新建PythonProject文件夹

新建一个文件,例如 helloworld.py

helloworld.py 填写 print(“hello world”)

D盘下运行 python helloworld.py

运行结果:hello world



helloworld.py

print("hello world")




D:\PythonProject>python helloworld.py
hello world
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python cmd hello-world