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

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. 
主站蜘蛛池模板: 枞阳县| 昔阳县| 城步| 萨嘎县| 都匀市| 嘉祥县| 保亭| 双流县| 汪清县| 陆良县| 资源县| 南开区| 张家港市| 定结县| 乌兰察布市| 万宁市| 大化| 壶关县| 青神县| 永宁县| 孟村| 枣庄市| 阳江市| 聂荣县| 阿克苏市| 敖汉旗| 通州区| 通州市| 富裕县| 新民市| 阿荣旗| 灵武市| 山东省| 鄂伦春自治旗| 祁门县| 文安县| 财经| 金塔县| 钟山县| 将乐县| 汪清县|