I have a file in which i have set up my credentials; i have named it creds.py. The content looks something like this :-
{ "username": "abc",
"password": "xyz" }
i am trying to import this in my main.py file
import json
import sys
import urllib.request
import urllib.response
import creds
def main():
credentials = creds
with open('credentials') as f:
credentials = json.load(f)
But i keep getting this error message :-
with open('credentials') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'credentials'
Can someone please point out what i am doing wrong? Any help will be appreciated.
os.getcwd()(with import os) to figure out where your program thinks it is./home/user/my-directory. This is where all the files are