How to Change Python Error Messages from Chinese to English
You can change Python error messages from Chinese to English by adding the following statement at the beginning of your Python code:
import os
os.environ['LANG'] = 'en_US.UTF-8'
This will set the error message language to English. However, note that this setting only affects the current program. If you want to permanently change the system language settings, you need to do it within your operating system.
原文地址: https://www.cveoy.top/t/topic/ocpD 著作权归作者所有。请勿转载和采集!