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

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.

主站蜘蛛池模板: 弋阳县| 始兴县| 靖江市| 平远县| 宾阳县| 临朐县| 灯塔市| 五原县| 贡山| 繁昌县| 博野县| 永福县| 丰镇市| 东光县| 平罗县| 巴林左旗| 东宁县| 兴义市| 漠河县| 永仁县| 余江县| 德钦县| 阜宁县| 蒲城县| 淅川县| 璧山县| 鄂温| 西丰县| 桃源县| 都兰县| 繁峙县| 武穴市| 海南省| 尼木县| 马关县| 绥德县| 西贡区| 桐城市| 保定市| 浠水县| 安阳市|