print(sys.stdout.encoding, locale.getpreferredencoding ())

windows console : chcp 65001;

在设置了这个环境变量时

通过

set PYTHONIOENCODING=utf-8

或(PowerShell 下)

$env:PYTHONIOENCODING = "utf-8"

PYTHONIOENCODING 指定的编码方式会覆盖原来的 sys.stdout.encoding 。如果将 PYTHONIOENCODING 设置为 utf-8,那么 Python 在输出 Unicode 字符串的时候就会以 UTF-8 输出,相当于什么也不转换。

python console的更多相关文章

  1. 不能在Python Console中运行pytest

    在Python Console中运行pytest发现报错了 这是为什么?因为Python Console已经是进入python之后的环境,就像在python自带的IDLE中运行pytest pytes ...

  2. Pycharm中Python Console与Terminal的区别

    1.Python Console是Python交互式模式,可以直接输入代码,然后执行,并立刻得到结果 2.Terminal是命令行模式,与系统的CMD(命令提示符)一样,可以运行各种系统命令

  3. pycharm Python Console调试 & django 调试

    1.设置断点,然后debug     2.如果在运行中想修改变量,可以直接在pycharm中修改 如将列表的 13改成3,然后选中 Excuting Selection in console     ...

  4. color the python console text

    //install termcolor module cd \ cd python27 cd scripts pip install termcolor pip install colorama // ...

  5. python Console menu

    I just finished a demo which is to provide an easy way to control hardware resources of A sample. Th ...

  6. QGis 利用Python Console编写脚本进行批量处理

    前言 这篇文章里,我们要完成一些数据的合并,计算等操作. 准备工作 首先要了解Qgis的编程模型,具体参考文章<QGIS里的编程模型>及<Qgis里的查询过滤>.了解了Qgis ...

  7. python console 设立快捷键 学习源码 用到英语

    arbitrary---随意 iterable----迭代 invalid syntax   -----无效的语法 subscriptable   ----可索引访问的

  8. pycharm的python console报错CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 87, in init self.matchers.remove(self.python_matches) ValueError: list.remove(x): x not in list

    卸载ipython pip uninstall ipython 安装ipython6.2.0 pip install ipython==6.2.0

  9. python console的命令执行

    命令 from app01 import models models.UserInfo.objects.all()查询出所有内容

随机推荐

  1. makefile之strip函数

    #$(strip <string> ) #名称:去空格函数--strip. #功能:去掉<string>字串中开头和结尾的空字符,并将中间的多个连续空字符(如果有的话)合并为一 ...

  2. RFID Hacking–资源大合集

    原文: http://www.freebuf.com/news/others/605.html http://www.proxmark.org/forum/index.php RFID破解神器官方论坛 ...

  3. [shell]C语言调用shell脚本接口

    Use popen if you want to run a shell command and want the parent process to be able to talk to the c ...

  4. 如何测试是否安装了web服务器

    windows默认没有安装web服务器,我们可以安装IIS. 我们安装个tomacte服务器,开发web程序必须的!!如果测试后出现这个页面说明安装成功le ! 我们这个安装的是本地服务器,可以把we ...

  5. 如何找到文件的家-打开文件对话框openFileDialog

    private void button1_Click(object sender, EventArgs e) { openFileDialog1.Filter = "*.txt|*.txt& ...

  6. Android之SystemUI载入流程和NavigationBar的分析

    Android之SystemUI载入流程和NavigationBar的分析 本篇仅仅分析SystemUI的载入过程和SystemUI的当中的一个模块StatusBar的小模块NavigationBar ...

  7. sqlite3命令读出sqlite3格式的文件内容案例

    /*********************************************************************  * Author  : Samson  * Date   ...

  8. asp.net 后台调用confirm

    using System;using System.Web.UI; public partial class _Default : System.Web.UI.Page, IPostBackEvent ...

  9. 原生sqlServer数据库连接

    package tj.test.demo; import java.sql.DriverManager;import java.sql.SQLException;import java.sql.Sta ...

  10. [插件] 如何在一个页面中使用多个SWFUpload对象上传文件

    首先需要引入相应的样式和JS文件,还需要借助jQuery的js 提供下载路径:http://pan.baidu.com/s/1EUzca ① 引入js <script type="te ...