猫史档案馆


Python模拟DOS操作系统2.0!

用户:楊輄_FixedStar楊輄_FixedStar查看:3 回复:1 评论:3 创建时间:2024-07-21T21:26:57


代码相比较1.0更加精简!但是上次的bug还没有修复,没有解决方法。希望大佬指点! defwelcome(): print("YangGuangDOSv2.0") welcome() defhelp(): tlk=input("ChineseorEnglish?") iftlk=='Chinese': print("======帮助======") print("好的,帮助已切换成中文!") print("System_Info-----系统信息") print("Sc-----进行简单的两数加法计算") print("menu-----系统菜单") print("settings-----系统设置") eliftlk=='English': print("======help======") print("OK,helphasbeenswitchedtoEnglish!") print("System_Info-----SystemInfor喵") print("Sc-----performsasimpletwo-numberadditioncalculation") print("menu-----systemmenu") print("settings-----systemsettings") else: print("======help======") print("Unknownlanguage,automaticallyswitchedtoEnglish.") print("System_Info-----SystemInfor喵") print("Sc-----performsasimpletwo-numberadditioncalculation") print("menu-----systemmenu") print("settings-----systemsettings") defSystem_Info(): print("Thisversionisbeta1.0.0andwillbecontinuouslyupdated.") print("BasedonPython,itisessentiallyaparsingoperatingsystem,andiscompletelyopensource!") print("https://space.bilibili.com/1359062377?spm_id_from=333.337.0.0") print("Havefunwithit!") defsetting(): print("1.systemsetting") print("2.passwordsetting") tel=input("Pleaseenteranumbertoselect(1or2):") iftel==1: print("=====setting======") print("None") iftel==2: print("=====passwordsetting=====") print("None") defmath(): a=float(input()) i=input() ifi=='+': b=float(input()) print(a+b) ifi=='-': b=float(input()) print(a-b) ifi=='*': b=float(input()) print(a*b) ifi=='/': b=float(input()) print(a/b) ifi=='**': b=float(input()) print(a**b) ifi=='%': b=float(input()) print(a%b) ifi=='//': b=float(input()) print(a//b) tll='0' defmenu(): print("1.off") tll=input("Pleaseenteranumbertoselect:") iftll=='1': print("Goodbye!") exit() iftll=='2': print("Youcanuse'*help'toviewthehelp.") print("Thisversionisbeta1.0.0andwillbecontinuouslyupdated.") print("BasedonPython,itisessentiallyaparsingoperatingsystem,andiscompletelyopensource!") print("https://space.bilibili.com/1359062377?spm_id_from=333.337.0.0") print("Havefunwithit!") defwrite(): file_path="C:/Users/yangy/Desktop/write.txt" file=open(file_path,'w') print("Pleasewrite.") words=input("") file.write(words) file.close() name=input("用户名:") print("欢迎你!",name,"!") print("welcometosunbeamOS!") defSyntaxError_(): print("!!!Thisisnotanexecutablesyntax,pleasetryagain!!!") deftalk_(): talk=input() iftalk=='*help': help() iftalk=='System_Info': System_Info() iftalk=='math': math() iftalk=='setting': setting() iftalk=='off': menu() iftalk=='write': write() whileTrue: talk_()  


回复

上一页1 页 / 共 1下一页
明_明_

孩子,Dos不能进行任何计算操作。我建议你还是去msdn.cn下载喵的ms-dos6.22用个半年吧,不然我实在看不下去。没有用过dos就来乱说那个是dos,命令提示符都不算是dos。现在市面上都没有几个人能随便编一个dos出来(除了2008年那一阵子的开放源码运动有几十个人编了一个freedos)。

点赞0


评论