官术网_书友最值得收藏!

Working with Python

Python can be programmed through an interactive command line (the interpreter), but anything you code won't be saved. Once you close the session it all goes away. To save your program, it's easiest to just type it in a text file and save it (be sure to use the .py extension, that is, foo.py).

To use the interpreter, simply type python at the command prompt (*nix and Mac) or click the Python application icon (Windows and Mac). If you're using Windows and installed the Python .msi file, you should be able to also type python at the command prompt, or find the launch icon in the Start menu.

Though they may look the same, the main difference between the Python interpreter and the system command prompt is that the command prompt is part of the operating system while the interpreter is part of Python. The command prompt can be used for other tasks besides messing with Python; the interpreter can only be used for Python.

Note that  *nix is used throughout this book to denote any UNIX-like operating system, such as Linux, BSD, and others, as these OSes tend to have similar functionality. 
主站蜘蛛池模板: 石楼县| 余庆县| 启东市| 淮南市| 长岛县| 磐石市| 密云县| 卢龙县| 南投市| 波密县| 祁东县| 历史| 咸阳市| 三亚市| 峡江县| 哈尔滨市| 怀集县| 陆河县| 哈尔滨市| 东乡| 泰和县| 汝阳县| 惠东县| 丹棱县| 马公市| 南平市| 许昌市| 江门市| 原平市| 南阳市| 阳信县| 庆云县| 弋阳县| 建阳市| 垣曲县| 叶城县| 察哈| 华坪县| 忻城县| 商丘市| 民权县|