I am using a Python scripted input that needs to read from a text file an encoded username and password. The script then writes the results from an API call to a JSON file. So the pseudocode looks like this:
with open('key.txt', 'r') as file:
set username and password
data = API call
with open('json', 'w') as file2:
write data
My script is throwing an error saying that the key.txt file does not exist when it is definitely in the same directory. Are there any permission issues that could be causing this?
Issue has been fixed, the scripts required the absolute file path since the python file is not running from the context of the folder it is stored in.
Issue has been fixed, the scripts required the absolute file path since the python file is not running from the context of the folder it is stored in.