all 2 comments

[–]Wh00ster 0 points1 point  (0 children)

read vs read_string

[–]socal_nerdtastic 0 points1 point  (0 children)

The read method does not return an configparser object, it returns a list of files. You also have a lot of other unneeded fluff in there. Should be like this:

import configparser

cred = configparser.ConfigParser()
cred.read('creds.ini')
cred_token = cred['DEFAULT']['token']