当前位置: 首页 > 后端技术 > Python

5愚蠢无聊的Python程序

时间:2023-03-26 18:27:16 Python

Python可以做很多无聊但有趣的事情,比如下面的一些例子。请勿贴出以下程序的代码,否则将无法达到您的刁钻目的。有意思的是打包成exe程序发给朋友。使用pip安装pyinstaller。打包命令如下:pyinstaller-Ffilename.py如果过程中有BUG(一般是编码错误),文末有解决方案。一个无聊的程序whileTrue:n=input("猜猜我在想什么?")print("Wrongguess")你的朋友永远不会知道你在想什么。当然,我安装完360之后,程序就消失了。如果你有兴趣研究反杀,可以给这篇文章点个赞。100个赞后,我会出一套Python防杀教程。无聊的程序2致命弹窗importtkinter.messageboxwhileTrue:tkinter.messagebox.showerror('Windowserror','你的电脑被攻击了!')运行后会很精彩,要是对方可以'tkill进程,更精彩。第三个无聊的程序调用默认浏览器,无限打开CSDN,让他爱上了学习。importwebbrowserwhileTrue:webbrowser.open('www.csdn.net')嗯,用了之后,自己的电脑死机了。InstantCPU...第四个无聊的程序这个程序比较动态,弹窗会随机出现。将tkinter导入为tkimportrandomimportthreadingimporttimedefboom():window=tk.Tk()width=window.winfo_screenwidth()height=window.winfo_screenheight()a=random.range.randrange(0,andwidth=)height)window.title('你是一只傻狍子')window.geometry("200x50"+"+"+str(a)+"+"+str(b))tk.Label(window,text='你是一只傻狍子deer',bg='green',font=('宋体',17),width=20,height=4).pack()window.mainloop()threads=[]foriinrange(100):t=threading.Thread(target=boom)threads.append(t)time.sleep(0.1)threads[i].start()运行效果如下图,很精彩,可以任意修改。第五个无聊的节目这个节目在我看来可以排在第一位,甚至可以和当下最火的枪炮茅台套在一起。ImportOsimportTimea=""OOOOOOOOOOOOOOOOOAOOOAOOAOOAOOAOOAOAOOAOAOAOAOAAOAAAAAAAAAAOAAAAAAEAAEAAAAAAAAEAAEAAEAAAAAEationationationationationationsssssssssssssssssssssssssssssssssssssswithonwithwithwithwithwithwithutwithwithwithwithwithwithwithwithwithwiththwithwithwithwithwithwithwithwithwithwithcesdwithwithsndhisad888OOOOOOOOOand888888888888`"y8888o.D88'88BD88'"Y888.8p'888888888888888888"888.O888.O8888`888.888888.O.88PO888bood8p'8""88888p'Y8BOD8P'Y8BOD8P'O888oO888oO8818oO88888oO888oO8818oO888点特征列表82.购买商品时"""print(a)key=input("请选择:")ifkey=="1":time.sleep(1.5)print('没有预约\n')time.sleep(3)print('nothingYes,comeandhug\n')else:print("Inthiscase...")time.sleep(3)print(&quo吨;那你脑洞大开~~~~~")os.system('shutdown-r-t10')time.sleep(10)别跑了,跑了别怪我,去吧给小伙伴开个玩笑,更多Python技术干货,请到gzh【Python编程学习圈】了解更多,这里还有大量的学习资料和教程可以免费获取,感兴趣的可以去看看。