Hi all, I have an issue that I absolutely cannot get around. When I run my script in the app, it works perfectly fine. Everything is normal. When I call my app through Safari it still runs normally, with the exception that it refuses to append to another file.
So to be clear: the only problem is when accessing the closed app using Pythonista://CoordinatesGet.py?action=run it doesn't write to my file. It DOES write to my file if I call it again, with the app already open, and it DOES write to my file when running the program normally from within the app. Here is my code:
theFile = open('CoordinatesList.txt','a')
import location
location.start_updates()
myCoords=location.get_location()
location.stop_updates()
longitude=str(myCoords['longitude'])
latitude=str(myCoords['latitude'])
theFile.write('\n')
theFile.write(longitude)
theFile.write('\n')
theFile.write(latitude)
print 'Coordinates:',latitude, longitude
I really appreciate the help! I'm starting to think it's a bug.