当前位置:网站首页>模块导入reload方法
模块导入reload方法
2022-06-30 01:25:00 【Martin の Blog】
添加路径
import sys
sys.path.append("./home")
print(sys.path) # ["", "./home"] ===> import 的指定路径
重新导入模块
定义run.py文件
def run():
print("this is run function")
导入模块
>>> import run
>>> run.run()
this is run function
修改run.py文件
def run():
print("this is run function")
print("this is run function")
导入模块
>>> import run
>>> run.run()
this is run function
重新导入run模块
>>> from imp import reload
>>> reload(run)
>>> run.run()
this is run function
this is run function
边栏推荐
- 第八届“互联网+”大赛 | 云原生赛道邀你来挑战
- Twitter launches the test of anti abuse tool "safe mode" and adds enabling prompt
- js Array.from()的5个便捷应用
- 快手伸手“供给侧”,找到直播电商的“源头活水”?
- Understanding of int argc, char * * argv in C language main function
- Varnish 基础概览1
- JS returned content is encoded by Unicode
- ES6 one line code for array de duplication
- 2020-12-03
- 一文读懂,MES管理系统模块功能
猜你喜欢

如何统一项目中包管理器的使用?

How to build your own blog website by yourself

【PyTorch实战】生成对抗网络GAN:生成动漫人物头像

In depth analysis of a large number of clos on the server_ The root of wait

Seata 与三大平台携手编程之夏,百万奖金等你来拿

R language linear regression model fitting diagnosis outliers analysis of domestic gas consumption and calorie examples with self-test questions
![[recommended] how to quickly locate a bug during testing](/img/7a/726b2ea02ac5feb40e7378ba49e060.jpg)
[recommended] how to quickly locate a bug during testing

Analysis of IM instant messaging development technology on modern web

JS content confusion, return content encryption

cookie加密8
随机推荐
Varnish 基础概览5
Three text to speech artifacts, each of which is very practical
Internal class usage scenarios, syntax and principle explanations
【图神经网络】图分类学习研究综述[2]:基于图神经网络的图分类
Database application
How does webapi relate to the database of MS SQL?
Varnish 基础概览7
The unity editor randomly generates objects. After changing the scene, the problem of object loss is solved
MES管理系统功能模块之质量管理
HC32M0+ GPIO
Wechat applet - requestsubscribemessage:fail can only be invoked by user tap gesture
JS content confusion, return content encryption
[recommendation system] concise principle and code implementation of user based collaborative filtering
快手伸手“供给侧”,找到直播电商的“源头活水”?
Solution to webkitformboundaryk in post request
“乘风破浪”的芒果超媒,能上岸吗?
ES6 synchronous asynchronous execution and block level scope
Shell spec date format
MySQL function
R语言线性回归模型拟合诊断异常值分析家庭燃气消耗量和卡路里实例带自测题