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

Make Python scripts executable when clicked on

The final step in making the scripts run when double-clicked (which also means they can run outside of the ArcGIS environment, saving lots of memory overhead) is to associate files with the .py extension with the Python interpreter. If the scripts have not already been associated with the interpreter, they will appear as files of an unknown type or as a text file.

To change this, right-click on a Python script. Select Open With, and then select Choose Default Program. If python.exe or pythonw.exe does not appear as a choice, navigate to the folder that holds them (C:\Python27\ArcGIS10.2, in this case) and select either python.exe or pythonw.exe. Again, the difference between the two is the appearance of a terminal window when the scripts are run using python.exe, which will contain any output from the script (but this window will disappear when the script is done). I recommend using pythonw.exe when executing scripts, and python.exe to test code.

Note

Python scripts can also explicitly call pythonw.exe by adjusting the extension to .pyw instead of .py.

主站蜘蛛池模板: 安义县| 津市市| 阳江市| 资阳市| 吉水县| 巩留县| 礼泉县| 乐东| 枝江市| 宝鸡市| 汉阴县| 宁德市| 高雄县| 沾化县| 潞城市| 海丰县| 阿拉善盟| 丘北县| 清苑县| 嘉荫县| 巨鹿县| 乌拉特前旗| 泸西县| 达孜县| 柘城县| 荣成市| 汤阴县| 福建省| 嘉荫县| 大石桥市| 巢湖市| 平原县| 黑河市| 隆化县| 贺州市| 宁德市| 木里| 化州市| 永定县| 灌南县| 诸城市|