0
是否有可能在Python中编写一个单线程with
上下文管理器?Python上下文管理器一个班轮
喜欢的东西:
with open('xml_file.xml') as file: file.write('<fave_food>filled dhal puri roti</fave_food>')
是否有可能在Python中编写一个单线程with
上下文管理器?Python上下文管理器一个班轮
喜欢的东西:
with open('xml_file.xml') as file: file.write('<fave_food>filled dhal puri roti</fave_food>')
是的,但你必须打开该文件,如果你想在这上面写写字。
就是这样 - 谢谢! – category