首页 > 编程语言 >PythonOS-原创高仿MS-DOS的Python程序

PythonOS-原创高仿MS-DOS的Python程序

时间:2024-08-26 12:57:41浏览次数:10  
标签:elif Python sr PythonOS 高仿 print input txt

这个Python程序需要依赖猿编程的内置模块,所以请先下载猿编程。

00x1:代码部分

PythonOS是免费且开源的。

使用方法:在猿编程里点击代码实验室,点击加号添加作品,然后将代码复制到作品里(代码放在文末),然后在电脑桌面上建立一个文件夹,在文件夹里创建BootLoad.txt,内容为Load 创建verinfo.txt,内容为5.2024.8.26.1 创建weather.txt,内容为1 创建tianmiserver.txt,内容为1。创建完成后,回到猿编程,点击左上角的默认文件.py,点击加号,把创建好的文件全选上点击打开。导入完成后点击默认文件.py,然后点击右下角的运行。然后点击右上角方框把输出区全屏,即可在输出区进行操作(不知道命令的话,会Python的直接去翻代码,不会Python的在输出区输入help单击Enter键即可查看支持的命令列表。

00x2:文末

PythonOS代码:

#1关闭,2开启
TianmiServeronoff=1
#开始引导PythonOS
bg56=open('verinfo.txt','r')
bootver=bg56.read()
print('Tianmi Bios(V3.2WorkStation'+bootver+')')
bg56.close()
#2.2023.6.10.3)
print('Booting from Hard disk......')
print('Start Booting ‘PythonOS x64 Home English Edtion’')
servicelist=['csrss.com','conhost.com','lsass.com','lsm.com','svchost.com','explorer.com','TianmiService.com','importrBehindService.com','importrMode.def']
home=['Windows10(THis machine)']
home2=['Windows10(THis machine)']
#进入PythonOS界面
print('Tianmi Group PythonOS Home English Edtion’[version3.2WordStation2.1.2024.2.22.2]')
print('All Rights Reserved(C)2024Tianmi Group')
while True :
    sr=input('C:/_')
    if sr=='ver':
        print('2024Tianmi Group.All Rights Reserved.')
    elif sr=='service':
        servicelist2=str(servicelist)
        print('Running Service:'+'\n'+ servicelist2)
    elif sr=='cd d:':
        cdexit=0
        while cdexit==0:
            cdsr=input('D:/_')
            if cdsr=='cd ..':
                cdexit=666
            elif cdsr=='shutdown':
                print('By Xhalo')
                input('s=hutdown r=estart')
                print('Error!')
            elif cdsr=='windowssteup':
                grie=0
                while grie==0:
                    print('Windows 2000安装程序')
                    print('==================')
                    print('')
                    print('')
                    print('')
                    print('')
                    print('')
                    print('')
                    print('')
                    print('(A)安装Windows2000到您的计算机')
                    print('(B)修复您的计算机')
                    print('(C)退出Windows2000安装程序')
                    print('')
                    winsteup=input('_')
                    if winsteup=='A' or winsteup=='a':
                        print('安装程序找不到Microsoft 软件许可条款,请检查您的安装源有效')
                    if winsteup=='B' or winsteup=='b':
                        print('安装程序找不到Microsoft 软件许可条款,请检查您的安装源有效')
                    if winsteup=='C' or winsteup=='c':
                        grie=1
                        print('安装程序已退出')
            elif cdsr=='attrib':
                print('cd ..')
                print('shutdown')
                print('windowssteup')
            else:
                print('‘'+cdsr+'’'+'Not an internal or external instruction, nor a program or batch file that can be executed')
    elif sr=='exit':
        print('System is close')
        break
    elif sr=='debug/v':
        debug=input()
        r5g=open('verinfo.txt','w')
        r5g.write(debug)
        debug=0
    elif sr=='tianmiservice':
        if TianmiServeronoff==1:
            print('Tianmi server is under maintenance, please try again later')
        elif TianmiServeronoff==2:
            print('Welcome to TianmiServer!')
            input('UserName:')
            input('PassWord:')
            print('Error! ‘TianmiServer’ Abnormal shutdown!')
        else:
            print('您的系统遭遇未知错误 : 0x205830')
            txt=open('BootLog.txt','w')
            txt.write('Bootloader=114514'+'\n'+'The System cannot Boot')
    elif sr=='hellopythonos.txt':
        print('‘蜂蜜记事本’ is Starting......')
        ybc_time.sleep(2)
        print('欢迎使用蜂蜜记事本!')
        print('开始阅读:')
        print('a PythonOS is Running in Python on Windows')
        print('       By 刘夏杰')
        print('记事本已关闭。')
        print('Error! ‘蜂蜜记事本’ Abnormal shutdown!')
    elif sr=='homecenter':
        home3d1='noexit'
        print('Welcome to HomeHub PythonOS!')
        print('1.View a list of family members')
        print('2.View the family name')
        print('3.List of home devices')
        print('4.About Home Center')
        print('5.quit')
        while home3d1=='noexit':
            home3=input('Please enter a serial number')
            if home3=='1':
                print(home)
            elif home3=='2':
                print('New Family 1')
            elif home3=='3':
                print(home2)
            elif home3=='4':
                print('Tianmi Group Home Center V2.0')
            elif home3=='5':
                home3d1='exit'
            else:
                print('You did not enter a serial number')
    elif sr=='feedback':
        fk=input('?')
        text2=open('feedback.txt','w')
        cache1=fk
        text2.write(cache1)
        text2.close()
        cache1=0
        fk=0
    elif sr=='chkdsk':
        input('Please enter the drive you want to check')
        print('Error:NOT FOUND: C:/APPITL/diskgenius/chkdsk.com')
    elif sr=='systeminfo':
        print('Xhalo Group PythonOS Home English Edition')
        print('Model:Think Book14 2023 锐龙')
        print('processor:Xhalo(R)X-CPU [email protected]')
        print('System type: 64-bit operating system')
    elif sr=='chrome' or sr=='edge' or sr=='iexplorer':
        print('The application cannot be started because the setting .dll is missing'+'\n'+'Reinstalling the application may resolve the issue.')
    elif sr=='help':
        print('servicelist----------服务列表')
        print('chrome / edge / iexplorer----------浏览器')
        print('hemecenter----------家庭中心')
        print('systeminfo----------关于本机')
        print('setting----------设置')
        print('chkdsk----------硬盘检查')
        print('hellopythonos.txt----------蜜蜂记事本-文件')
        print('weather----------天气')
        print('ver----------系统版本')
        print('exit----------退出')
    elif sr=='attrib':
        print('servicelist')
        print('chrome')
        print('edge')
        print('hemecenter')
        print('systeminfo')
        print('setting')
        print('chkdsk')
        print('hellopythonos.txt')
        print('weather')
        print('ver')
        print('exit')
    elif sr=='setting':
        seexit='noexit'
        while seexit=='noexit':
            print('1.About this unit')
            print('2.Shutdown')
            print('3.quit')
            setting=input('Please enter a serial number')
            if setting=='1':
                print('Xhalo PythonOS Home Edtion')
                print('Model:Think Book14 2023 锐龙')
                setting=input('Please enter a serial number')
            if setting=='1':
                print('Xhalo PythonOS Home Edtion')
                print('Model:Think Book14 2023 锐龙')
                print('processor:Xhalo(R)X-CPU [email protected]')
                print('System type: 64-bit operating system')
            elif setting=='2':
                import ybc
                ybc.play('error.wav')
                print('Error: You need SYSTEM permission to execute this batch file')
            elif setting=='3':
                seexit='exit'
    else:
        print('‘'+sr+'’Not an internal or external instruction, nor a program or batch file that can be executed')

本程序由夏蓝云(刘夏杰)原创

标签:elif,Python,sr,PythonOS,高仿,print,input,txt
From: https://blog.csdn.net/2403_86920786/article/details/141560993

相关文章

  • python调用ollama库详解
    0准备1)准备Ollama软件(注意:两个不是同一个东西)详见上次的文章 Ollama通过gguf文件加载AI模型(补充:关于Ollama加载AI模型的补充)2)准备ollama库如果您还未安装ollama库,请使用pip安装:pipinstallollama#1ollama库的基本使用importollama#普通输出(请先按照准备工作中......
  • Python系列(9)- Python 异常处理机制
    1.错误和异常   编程开发时一般会遇到2种类型的错误,分别为语法错误和运行时错误。   语法错误(SyntaxError):Python解释器在解析代码时遇到的错误,比如拼写错误、不符合语法规则等。Python解释器会提示错误的类型和出错的位置,便于开发者及时纠正错误,在错误没有得......
  • MacOS安装 Python 和 PyCharm
    MacOS安装Python3.12.5和PyCharm小阿呜有话说一、MacOS安装PythonPython官网下载二、MacOS安装PyCharmPyCharm官网下载叮嘟!这里是小啊呜的学习课程资料整理。好记性不如烂笔头,今天也是努力进步的一天。一起加油进阶吧!小阿呜有话说前不久换了新电脑,需要重新......
  • Python批量发送邮件如何实现邮件群发策略?
    Python批量发送邮件怎么定制化?如何使用Python发信?Python批量发送邮件已经成为一种不可或缺的工具。Python批量发送邮件都能大大提高效率,节省时间和资源。AokSend将详细介绍如何利用Python批量发送邮件实现高效的邮件群发策略。Python批量发送邮件:设置环境要开始Python批量......
  • Python画笔案例-012 绘制空心T字
    1、绘制空心T字通过python的turtle库绘制一个空心T字的图案,如下图:2、实现代码 绘制以上空心T字的图案,代码如下:"""空心T字.py"""importturtle#导入海龟模块turtle.pensize(2)#设定海龟画笔粗细为2turtle.setheading(90)......
  • Python画笔案例-013 绘制水墨风格画
    1、绘制水墨风格画通过python的turtle库绘制一个水墨风格画的图案,如下图:2、实现代码 绘制以上水墨风格画图案,代码如下:"""水墨风格画.py"""importturtle#导入海龟模块turtle.penup()#抬笔turtle.goto(-200,-200)#坐......
  • 利用python连接MySQL数据库
    利用python连接MySQL数据库1、准备工作:(1)事先在系统中已经安装好mysql数据库(2)在系统控制台通过pipinstallpymysql,安装python的第三方数据库模块2、利用python连接数据库#导入模块importpymysql#连接数据库conn=pymysql.connect(host="127.0.0.1",user="root",pas......
  • Python time时间格式化
    1、时间戳转换为指定格式日期importtimet=time.strftime("%Y-%m-%d%H:%M:%S",time.localtime())print(t)timestamp=time.time()tuple_time=time.localtime(timestamp)print(tuple_time)print(time.strftime("%Y-%m-%d%H:%M:%S",tuple_time)) ......
  • VaR(风险价值模型)的Python实现案例
    VaR(ValueatRisk)即风险价值模型,是一种衡量市场风险的统计指标,用于估计在一定置信水平下,某一金融资产或证券组合在给定时间内可能遭受的最大损失。VaR的提出背景是为了解决传统资产负债管理方法的时效性不足和无法准确度量金融衍生品种的风险等问题例如,如果VaR是-5%,这意味着在......
  • [oeasy]python031_[趣味拓展]unix起源_Ken_Tompson_Ritchie_multics
    [趣味拓展]unix起源_Ken_Tompson_Ritchie_multics......