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

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.

主站蜘蛛池模板: 刚察县| 临洮县| 深州市| 巴林右旗| 瓦房店市| 武山县| 舞钢市| 铁力市| 永吉县| 繁峙县| 平武县| 西城区| 建湖县| 龙井市| 庄河市| 保定市| 伽师县| 百色市| 尼木县| 婺源县| 阿图什市| 临汾市| 鄄城县| 乌海市| 芮城县| 沈丘县| 色达县| 古交市| 江源县| 丰都县| 阜康市| 盐亭县| 佳木斯市| 江津市| 开平市| 贵南县| 潜江市| 清流县| 土默特左旗| 革吉县| 镇康县|