from configparser import RawConfigParser import os cwd = os.getcwd() config = RawConfigParser() config.read( filenames=os.path.join( cwd, 'config.ini', ), ) class Telegram: token = config.get( section='Telegram', option='token', )