第2个回答 2010-03-05
有3种方法可以运行。
第一种:
C:\Users\zhaolei>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'hello world'
hello world
>>>
第二种:
C:\Users\zhaolei\Desktop>type hello.py
print "hello world"
C:\Users\zhaolei\Desktop>python hello.py
hello world
C:\Users\zhaolei\Desktop>
第3种:
C:\Users\zhaolei\Desktop>dir hello.py
驱动器 C 中的卷是 系统
卷的序列号是 8C1D-E748
C:\Users\zhaolei\Desktop 的目录
2010/03/05 10:03 19 hello.py
1 个文件 19 字节
0 个目录 7,746,240,512 可用字节
C:\Users\zhaolei\Desktop>python
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello
hello world
>>>