python如何调用函数库
爱喝马黛茶的安东尼
2019-10-14 11:30:527963浏览 · 0收藏 · 0评论
python对函数库引用的第一种方式
格式是: import<库名>
例如:
import turtle
如果需要用到函数库中函数,需要使用: <库名>.<函数名>
例如:
import turtle turtle.fd(100)
相关推荐:《Python基础教程》
python对函数库引用的第二种方式
格式是: from<库名>import<函数名>
from<库名>import *
调用函数不需要<库名>,直接使用<函数名>
例如:
from turtle import * fd(100)
关注公众号,随时随地在线学习