Select to view content in your preferred language

Embedded python code suddenly gone

224
2
12-12-2024 05:42 AM
Labels (2)
RandyMcGregor_BMcD
Frequent Contributor

This happens with some regularity. The embedded script in a python script tool gets replaced by the filepath to to the temp *.py file for the code. I am refraining from using embedding scripts for now because of this but if anyone knows why this is happening, I would be most grateful. It is handy to use embedded scripts. Thank you,

Randy McGregor

RandyMcGregor_BMcD_0-1734010876643.png

 

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

Edit script tool code—ArcGIS Pro | Documentation describes two methods, only one indicates that the toolbox's embedded code gets updated.

This is apparently a followup to your previous post

Embedded Python Code Disappearing - Esri Community

If the help topics need clarification or this is in error, it may be worth comment in the .... Feedback on this topic? ... link.  I find that comments generally make it back to the appropriate team

PS  I never embed because of the temporary file creation issue/aspect


... sort of retired...
0 Kudos
RandyMcGregor_BMcD
Frequent Contributor

Thank you, I have worked with embedded code a fair amount both within the 'properties' execution window and by opening the temporary .py file. Both work fine, and both will update the code, but sometimes the embedded code is simply replaced by the file path to the temporary file, and it's all over. I could have accidentally done this once, but it happens regularly and I'm not quite that absent minded :).

This is most definitely some sort of glitch, whether in ESRI's system or our own, I don't know. The topic explains how to update the code, but what I'm experiencing is not really a problem with the documentation, so not sure what feedback I could provide there. May open a support ticket at this point. 

It is a second post. Was hoping maybe someone else might have run into this in the meantime 😕 Anyway, thanks for the feedback. Looks like this one is just a mystery. I will avoid embedding code from now on.

0 Kudos