I have a python script running from ArcToolbox. Each time the script is run, it creates a new text file (testtext.txt), writes to it, then deletes it at the end.
Before the script is re-pointed, the source looks like this:
When I try to run the tool, I get the error:
If I go into the properties of the script and re-point the source to the exact same location as shown above, the script does work, and works fine every time thereafter. This problem happens when logged in as Administrator on the computer as well. Is there a way to ensure permission without having to re-point the source each time the tool is added to ArcMap?
I have "Store relative path names" enabled on the script properties. Here is the code snippet:
tempPath = sys.path[0]
newPath = os.path.join("testtext.txt")
open(newPath, 'w').close()
with open(newPath,"a") as newfile:
newfile.write("http://genericaddress/#/selections/place?query=")
outfile = open(newPath,"a")