如果可能的话,如何从正在运行的 python 进程中判断源文件的编码?
请您参考如下方法:
encoding = open(__file__).encoding
这在某些情况下可能有效,但请注意 http://docs.python.org/library/stdtypes.html#file.encoding
如果可能的话,如何从正在运行的 python 进程中判断源文件的编码?
请您参考如下方法:
encoding = open(__file__).encoding
这在某些情况下可能有效,但请注意 http://docs.python.org/library/stdtypes.html#file.encoding