本文共 1799 字,大约阅读时间需要 5 分钟。
2012-07-11 回答
python源文件通常用.py扩展名。当源文件被解释器加载或者显式地进行字节码编译的时候会被编译成字节码。由于调用解释器的方式不同,源文件会被编译成带有.pyc或.pyo扩展名的文件,您可以在第十二章“模块”中找到更多的关于扩展名的知识。1.4 downloading and installing python下载和安装pythonthe most obvious place to get all python-related software is at the main web site at . for your convenience, you can also go to the book’s web siteat and click on the “install python” link to the left—we have organized a grid with most contemporary versions of python for the most platforms, with a focus, of course, on the “big three.” unix, win 32, macos x. 有三种不同的办法来启动python。最简单的方式就是交互式的启动解释器,每次输入一行python代码来执行。另外一种启动python的方法是运行用python写的脚本程序。这样会调用相关的脚本解释器。最后一种办法就是从集成开发环境中的图形用户界面中运行python。集成开发环境通常带有其他的工具,例如集成的排错器、文本编辑器和支持大量源代码管理的工具cvs等。command-line options命令行选项when starting python from the command-line, additional options may be provided to the interpreter. here are some of the options to choose from:当从命令行启动python的时候,附加的选项可以提供给解释器。下面是供您使用的一些选项:-d provide debug output-o generate optimized bytecode (resulting in .pyo files)-s do not run importsite to look for python paths on startup-v verbose output (detailed trace on import statements)-m mod run (library) module as a script-q opt division options (see documentation)-c cmd run python script sent in as cmd stringfile run python script from given file (see later)-d 输出排错(debug)信息-o 生成优化的字节码(以.pyo文件形式)-s do not run importsite to look for python paths on startup-v verbose output (detailed trace on import statements)-m mod run (library) module as a script-q opt division options (see documentation)-c cmd run python script sent in as cmd string file 从给定的文件运行python脚本(下面会提到) pythonwin是第一个为python开发的windows接口界面,并且是一个带有图形用户界面的集成开发环境。pythonwin发行版本中包含windows api和com扩展。pythonwin本身是针对mfc库编写的,它可以被用作开发您自己的windows应用程序的开发环境。您可以从下面给出的网页中下载并安装它。pythonwin通常被安装在和python
转载地址:http://psdoo.baihongyu.com/