Python reload() 函数
2024-10-19 01:22:05
reload(module) 作用:
用于重新载入之前载入的模块。 module -- 模块对象。返回模块对象。 实例:
重新载入 sys 模块,并设置默认编码为 utf8
>>>import sys
>>> sys.getdefaultencoding() # 当前默认编码
'ascii'
>>> reload(sys) # 使用 reload
<module 'sys' (built-in)>
>>> sys.setdefaultencoding('utf8') # 设置编码
>>> sys.getdefaultencoding()
'utf8'
>>>
最新文章
- 在本地windows机器上安装SecureCRT客户端
- CMD 规范是不是就是 commonJS 规范?
- Struts2 之 对xwork的理解
- subprocess实现管道
- word to word
- svg学习(六)line
- IOS开发小项目—找色块游戏
- mac下为Apache 创建 .htaccess文件
- eclipse 下生成jar包
- 采用 HTML5 File API 达到client log
- 数据库索引的实现原理(笔记)详细http://www.linezing.com/blog/?p=798#nav-1
- Maven依赖解析
- php数据库备份脚本
- Mybatis集成到spring boot
- windows server 2008 r2 x64 enterprise service pack1中aspjpeg.dll安装
- ios -- 成员变量、实例变量与属性的区别
- 大数据处理框架之Strom: Storm----helloword
- ERROR org.redisson.client.handler.CommandDecoder - Unable to decode data. channel
- MongoDB 第一篇
- (20)模型层 -ORM之msql 基于双下划线的跨表查询(一对一,一对多,多对多)