I write a simple Python script to save data to the file system. When I run it from the terminal, it works fine.
Script:
html = 'some text'
html_file_name = 'test.html'
html_file = open(html_file_name, "w")
html_file.write(html)
html_file.close()
However, when I try to execute it from Keyboard Maestro, I get this error:
Traceback (most recent call last):
File "/Users/name/Desktop/save_html.py", line 12, in <module>
html_file = open(html_file_name, "w")
IOError: [Errno 13] Permission denied: 'test.html'
Line 12 is referring to `open(html_file_name, “w”)