Python Config Parser can't find section?
问题 I'm trying to use ConfigParser to read a .cfg file for my pygame game. I can't get it to function for some reason. The code looks like this: import ConfigParser def main(): config = ConfigParser.ConfigParser() config.read('options.cfg') print config.sections() Screen_width = config.getint('graphics','width') Screen_height = config.getint('graphics','height') The main method in this file is called in the launcher for the game. I've tested that out and that works perfectly. When I run this code