运用from...import....
例如:在main.py中,有自身的函数print_hi(), 调用hello.py中的两个函数
![](https://img-blog.csdnimg.cn/img_convert/3eaaf846c5390acf196f2a54c1732485.png)
在hello.py中
![](https://img-blog.csdnimg.cn/img_convert/41d0a483f197a3824e099077cf0c81d6.png)
把hello.py当成一个模块,其中的函数就是子模块(与库有点类似)
本人是个菜鸟新手,用于记录学习,防忘记,若有错误,请多多指正
运用from...import....
例如:在main.py中,有自身的函数print_hi(), 调用hello.py中的两个函数
在hello.py中
把hello.py当成一个模块,其中的函数就是子模块(与库有点类似)
本人是个菜鸟新手,用于记录学习,防忘记,若有错误,请多多指正