python对函数库引用的第一种方式
格式是: import<库名>
例如:
import turtle
如果需要用到函数库中函数,需要使用: <库名>.<函数名>
例如:
import turtle turtle.fd(100)
相关推荐:《》
python对函数库引用的第二种方式
格式是: from<库名>import<函数名>
from<库名>import *
调用函数不需要<库名>,直接使用<函数名>
例如:
from turtle import * fd(100)
Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务