大家好,今天小编关注到一个比较有意思的话题,就是关于python学习框架教程的问题,于是小编就整理了2个相关介绍Python学习框架教程的解答,让我们一起看看吧。
python selenium自动化测试框架如何搭建使用?
selenium是一个web自动化测试工具,本身向python提供编程接口,至于搭建使用的话,只需要安装一下selenium模块,并配置一下浏览器驱动就行,下面我简单介绍一下实现,感兴趣的朋友可以尝试一下:
1.首先,安装selenium模块,这个直接在cmd窗口输入命令“pip install selenium”就行,如下:
2.安装完成后,这里还需要下载对应的浏览器驱动,以谷歌浏览器为例,需要下载驱动chromedriver.exe(火狐浏览器是geckodriver.exe),不然程序在运行的过程中会报以下错误,提示chromedriver不存在(不在环境变量中):
3.下载的话,直接到***上下载就行,注意需要和自己平台的浏览器版本相匹配,不然浏览器启动会失败,导致程序崩溃:
解压后其实就是一个chromedriver.exe,需要将这个驱动配置到环境变量中,这个是程序运行的关键,浏览器能否正常启动,就看chromedriver.exe是否正常配置:
4.最后,一切配置完成后,我们就可以编写代码来测试selenium是否安装成功,以某度主页为例,如果可以正常浏览器并跳转到对应页面操作相关元素,则说明selenium安装成功:
才入门python,有哪些有趣的框架可以尝试?
Pygame:
基于c语言开发的游戏编写框架,由于是基于C语言写的,所以速度很快。一般游戏速度可以达到30到200帧。做游戏一般都是用60帧的,所以说这个模块给我们提供了很大的方便。可以看我的主页有Pygame教程。
turtle:
海龟绘图,可以画出一般图形,用它合理的画图可能会触发意想不到的效果。
beautifulsoup:
一个网络爬虫库,但我怀疑这作者有毛病!好好的名不起,非要起个漂亮的汤。像什么话?好吧,如果你起个beautifulboy,其实也行,只要好用就行。
scrapy:
又是一个网络爬虫库。我实在容忍不了了,如果说beautifulsoup还行,那西瓜皮又是什么鬼?发现编这个网络爬虫库的没有一个好东西。 [奸笑][奸笑][奸笑][奸笑][奸笑][奸笑]
pyinstaller:
可以在CMD控制行里输入pyinstaller来把Python编译成,EXE程序。
才入门python,有哪些有趣的框架可以尝试?这里简单介绍6个比较有趣的框架和库,感兴趣的朋友可以尝试一下:
绘图库turtle
这是python自带的一个标准绘图库,内置了大量函数,可以在二维平面绘制出你需要的任何图形,常见的各种卡通人物,哆啦A梦、小猪佩奇等都可轻松绘制,简单明了,只要你掌握了基本使用流程,各种有趣的图形都可以绘制出来:
词云库wordcloud
这是python一个专门用于绘制词云的第三方库,如果你经常做文本分析,统计词频,那么这个库非常合适,只需简单几行代码即可快速绘制出漂亮、美观、大方的词云图,一目了然,日常使用来说,在合适不过:
游戏开发pygame
这是python专门为游戏开发而设计的一个平台,摆脱了低级语言的束缚,使开发者可以投入到更多精力到游戏的设计和实现上,如果你需要开发一些小型游戏,像五子棋、贪吃蛇、飞机大战等,自娱自乐,可以使用一下库,非常不错:
这是python一个专门用于人脸识别的第三方库,基于dlib深度识别技术,可以快速[_a***_]出人脸,自带有第三方模型,不需要再进行额外训练,如果你需要进行人脸识别,而又缺乏合适的框架,可以使用一下库,非常不错:
视频下载工具you-get
这是python提供的一个网页***下载工具,当然,也是第三方扩展模块,可以轻松下载B站、优酷、美拍等网站***,无需编写任何代码,只需一行命令即可保存***到本地,支持在线播放、批量下载,日常使用来说非常方便实用:
网络爬虫scrapy
这是python一个非常著名的爬虫框架,免费开源,在业界非常流行,可定制化程度非常高,只需要简单几行代码即可快速开启一个爬虫程序,如果你日常生活中需要批量获取大量网页数据,而又缺乏合适灵活的工具,可以使用一下scrapy,非常不错,也非常容易学习和掌握:
当然,除了以上6个非常不错的框架或库,其实还有许多其他框架,像深度学习/机器学习的tensorflow,web开发的django/flask,数据处理的numpy/pandas等也都非常不错,可以查询一下相关资料,毕竟python第三方模块太多,网上也有相关教程,介绍的非常详细,感兴趣的话,可以搜一下,希望以上分享的内容能对你有所帮助吧,也欢迎大家评论、留言进行补充。
到此,以上就是小编对于python学习框架教程的问题就介绍到这了,希望介绍关于python学习框架教程的2点解答对大家有用。