自己的模块
作者: 编辑: 莫烦 发布于: 2016-01-01
自建一个模块¶
这里和视频有点差别,我自己写了另外一个模块,是计算五年复利本息的模块,代码如下:模块写好后保存在默认文件夹:balance.py
调用自己的模块¶
新开一个脚本,import balance
模块存储路径说明¶
在Mac系统中,下载的python模块会被存储到外部路径site-packages,同样,我们自己建的模块也可以放到这个路径,最后不会影响到自建模块的调用。
Content-Length: 66646 | pFad | https://mofanpy.com/tutorials/python-basic/basic/personal-module
Fetched URL: https://mofanpy.com/tutorials/python-basic/basic/personal-module
Alternative Proxies: