2024-06-01 09:20:01 发布
网友
在PC上使用法语(4.4)
for line in os.popen('dir'): print(line.rstrip())
我如期到达第一行
Le volume dans le lecteur C s'appelle SYSTEME
但对于第二个(用é)
Le numéro de série du volume est C250-47DD
我收到错误消息:
我能做什么? 提前谢谢你的帮助
在打印之前,您需要通过正确的编码对行进行编码:
for line in os.popen('dir'): print(line.rstrip().encode('UTF-8')) # as utf8 is a universal encoding i use it you can use another too
在打印之前,您需要通过正确的编码对行进行编码:
相关问题 更多 >
编程相关推荐