Categories
Mastering Development

Write a dictionary to a file containing TOML-formatted data with Japanese

Here is a test.py script Write a dictionary to a file containing TOML-formatted data: def createtoml(path): dst_file = “config.toml” if __name__ == “__main__”: a = { ‘download’:{ ‘path’:path } with open(dst_file, ‘w’) as f: r = toml.dump(a, f) name=input(‘Name:’) path=”F:\\\\”+name createtoml(path) If the input of name is Japanese or Chinese, such as まひろ, the TOML-formatted […]