在本地安装好后Python后,进入命令行模式,输入Python,就进入Python的交互模式:
C:\Users\user>pythonPython 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bitD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> exit;Use exit() or Ctrl-Z plus Return to exit>>> exit()
小试牛刀,打印第一个程序:
使用文本编辑器编写代码,然后再切换到命令窗口执行:
// 切换到D目录下,保存文件的路径下C:\Users\pocouser>D:D:\> cd Python\python// 执行文件D:\Python\python>python hello.pyhello,xiaojunD:\Python\python>
Mac环境中开发:
在终端先切换到文件所在的目录,然后再执行hello.py文件