安装了python IDLE之后,打开IDLE会有提示符 “ >>> ”这里是个shell环境。不是直接在这里写程序,要选择 文件- 新窗口 (file-new window) 出现新窗口然后输入
#! /usr/bin/python
#Filename:helloworld.py
print ('Hello World')
点保存 选择新窗口 run-run module 就可以在 shell窗口里看到
>>> ================================ RESTART ================================
>>>
Hello World
>>>
最后版本是
Python 3.2.2 (default, Sep 4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.