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

这个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 Pro2@3.30GHz')
        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 Pro2@3.30GHz')
                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')

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值