ini

ConfigParser - print config.sections() returns []

99封情书 提交于 2021-02-08 06:48:52
问题 I'm trying to use a ConfigParser module to parse an *.ini file. The problem is that when I try to print sections or whatever, it returns empty list [] . config.ini [SERVER] host=localhost port=9999 max_clients=5 [REGULAR_EXPRESSIONS] regular_expressions_file_path=commands/commands_dict config.py # -*- coding: utf-8 -*- import ConfigParser config = ConfigParser.SafeConfigParser() config.read("config.ini") print config.sections() [] Do you know where is the problem? EDIT: Here is a screen of my

ConfigParser - print config.sections() returns []

人盡茶涼 提交于 2021-02-08 06:48:52
问题 I'm trying to use a ConfigParser module to parse an *.ini file. The problem is that when I try to print sections or whatever, it returns empty list [] . config.ini [SERVER] host=localhost port=9999 max_clients=5 [REGULAR_EXPRESSIONS] regular_expressions_file_path=commands/commands_dict config.py # -*- coding: utf-8 -*- import ConfigParser config = ConfigParser.SafeConfigParser() config.read("config.ini") print config.sections() [] Do you know where is the problem? EDIT: Here is a screen of my

Can I have logging.ini file without root logger?

a 夏天 提交于 2020-12-29 06:38:28
问题 Here is how my logging.ini file looks like: [loggers] keys=teja [handlers] keys=fileHandler [formatters] keys=simpleFormatter [logger_teja] level=DEBUG handlers=fileHandler qualname=tejaLogger [handler_fileHandler] class=logging.FileHandler level=DEBUG formatter=simpleFormatter args=("error.log", "w") [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s I am getting the follwing error: File "test.py", line 22, in <module> logging.config.fileConfig('logging

Can I have logging.ini file without root logger?

微笑、不失礼 提交于 2020-12-29 06:38:12
问题 Here is how my logging.ini file looks like: [loggers] keys=teja [handlers] keys=fileHandler [formatters] keys=simpleFormatter [logger_teja] level=DEBUG handlers=fileHandler qualname=tejaLogger [handler_fileHandler] class=logging.FileHandler level=DEBUG formatter=simpleFormatter args=("error.log", "w") [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s I am getting the follwing error: File "test.py", line 22, in <module> logging.config.fileConfig('logging

Load base64-encoded data from INI file back to TPicture?

半世苍凉 提交于 2020-08-09 06:54:30
问题 In Delphi 10.4, I have sucessfully saved a valid TPicture base64-encoded to an INI file, using this code: procedure TForm1.SavePictureToIniFile(const APicture: TPicture); // https://stackoverflow.com/questions/63216011/tinifile-writebinarystream-creates-exception var LInput: TMemoryStream; MyIni: TMemIniFile; Base64Enc: TBase64Encoding; ThisFile: string; begin if FileSaveDialog1.Execute then ThisFile := FileSaveDialog1.FileName else EXIT; //CodeSite.Send('TForm1.btnSaveToIniClick: VOR

WriteBinaryStream compressed to INI file?

ε祈祈猫儿з 提交于 2020-08-08 06:29:33
问题 In Delphi 10.4, I try to save a valid TPicture compressed to an INI file, trying to replicate the ZLibCompressDecompress example from the documentation: procedure TForm1.SavePictureToIniFile(const APicture: TPicture); // https://stackoverflow.com/questions/63216011/tinifile-writebinarystream-creates-exception var LInput: TMemoryStream; LOutput: TMemoryStream; MyIni: System.IniFiles.TMemIniFile; ThisFile: string; LZip: TZCompressionStream; begin if FileSaveDialog1.Execute then ThisFile :=

WriteBinaryStream compressed to INI file?

≯℡__Kan透↙ 提交于 2020-08-08 06:29:16
问题 In Delphi 10.4, I try to save a valid TPicture compressed to an INI file, trying to replicate the ZLibCompressDecompress example from the documentation: procedure TForm1.SavePictureToIniFile(const APicture: TPicture); // https://stackoverflow.com/questions/63216011/tinifile-writebinarystream-creates-exception var LInput: TMemoryStream; LOutput: TMemoryStream; MyIni: System.IniFiles.TMemIniFile; ThisFile: string; LZip: TZCompressionStream; begin if FileSaveDialog1.Execute then ThisFile :=