Select to view content in your preferred language

Autocomplete file/path names in python script

2364
4
06-07-2020 07:50 AM
tt1
by
Emerging Contributor

I'm currently using Python to automate some geoprocessing in ArcGIS Pro. 

When editing code in the python window, I would like it to auto-complete the file names. For example, if I wish to dissolve "Canada.shp" I should be able to type "Ca" and hit tab for it automatically complete to "Canada.shp".~

This is a feature I'm used to in R and would like to know if it can be replicated in ArcPy. 

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

that capability is a function of the python ide.  It may not be implemented in the included python window because of the overhead needed to implement it.  Jupyter notebooks within pro implement a form of it

Notebooks in ArcGIS Pro—ArcPy Get Started | Documentation 

and other ide's (like Spyder) do so as well


... sort of retired...
0 Kudos
tt1
by
Emerging Contributor

Thanks for the reply. When I try in notebooks, the tab button will suggest modules rather than file/path names. 

For example if I hit tab on: arcpy.gapro.DissolveBoundaries(r"Ca

It will suggest "abs", "all" ...etc. 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

This could be related to Esri's note in Notebooks in ArcGIS Pro—ArcPy Get Started | Documentation :

Magic (%) and shell (!) commands are not supported in notebooks run from ArcGIS Pro at ArcGIS Pro 2.5.

I am not on my machine with Pro 2.6 on it to test if this has changed in the latest version. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

It has. Although I haven't checked the full list yet


... sort of retired...
0 Kudos