Use pycharm call os.system ( "dir") in the Windows system Why garbled

problem:

 

 

 

Because pycharm, the default encoding attribute of the file is set to UTF-8, and taken out dir Windows GBK information encoded form. So garbled when printed.

 

 

solution:

In the following settings, the encoding format is set to GBK, setting project encoding only valid

 

Guess you like

Origin www.cnblogs.com/zhubincheng/p/12601985.html