Does anyone know why the code in my python script tools is sometimes replaced by the filepath to the file that holds embedded code when it is being edited? 'Execution' used to hold a whole bunch of code.
Thank you,
Randy McGregor
You are using an external editor?
Does the code not reappear when you are done editing, save the edits, close the editor and refresh the toolbox? (may require closing and reopening the toolbox)
When I see that filepath, it's over. The code's gone. Can't get it back. I do have a *.py file saved and I used it to reconstitute the code. Using Idle for 3.0. But sometimes I edit right within the properties 'Execution' window. Keeps happening. I'm going to go old-school and have a separate *.py file feed the script. I have had this issue with embedded scripts periodically. It is truly distressing when you don't have a backup.
I decided to go with the separate *.py file, which is fine and is what I've done for years. The code is not disappearing anymore. I have noticed that if you are not careful and have more than one 'embedded code' window open, that can create (understandable) confusion which can result in the code being replaced by the path to the temporary file. That's not what happened here, BTW. Embedded code for Python tools just seems to be a bit flakey. This could be a bug?