|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | + |
| 3 | +""" |
| 4 | +Created on Sun Aug 29 13:08:33 2021 |
| 5 | +
|
| 6 | +@author: Charlie K.'Captain Awesome Junior' |
| 7 | +""" |
| 8 | + |
| 9 | +# Changes in PythOS Indev 2.1.1 Bug Fix 1: Fixed mechanics! |
| 10 | +# To add the wait functionality, we need to import time.sleep. |
| 11 | +from time import sleep |
| 12 | +PythOS_Ver = "Indev 2.1.1 Bug Fix 1" |
| 13 | +# Here is the name data in rows 18-19. |
| 14 | +print("PythOS - The new way to use Python.") |
| 15 | +ProcessorType = 1 |
| 16 | +print("Running PythOS on AMD64") |
| 17 | +fname = "" |
| 18 | +sname = "" |
| 19 | +TryNewDev = "" |
| 20 | +ActivatedPyPro = False |
| 21 | +def login(): |
| 22 | + print() |
| 23 | + global fname |
| 24 | + global sname |
| 25 | + fname = input("Type in your first name: ") |
| 26 | + sname = input("Type in your surname: ") |
| 27 | + print() |
| 28 | + print() |
| 29 | +def load(): |
| 30 | + print("Loading PythOS. Please wait...") |
| 31 | + global TryNewDev |
| 32 | + if fname == "admin" and sname == "admin": |
| 33 | + print("Welcome to PythOS. You currently have admin permisions") |
| 34 | + if fname == "Test" and sname == "123": |
| 35 | + TryNewDev = input("Developers should try the new PythOS Developer's Edition. Would you like to exit PythOS to run it?(Y/N):") |
| 36 | + if TryNewDev == "Y": |
| 37 | + print("Just a sec... ") |
| 38 | + sleep(5) |
| 39 | + print("""PythOS has shut down. |
| 40 | +You can now download PythOS Developers Edition at: |
| 41 | +https://github.com/Captain-Awesome-Jnr/PythOS-Dev-Edition |
| 42 | +
|
| 43 | +See you soon!""") |
| 44 | + else: |
| 45 | + print("Welcome to PythOS. Dev Mode activated.") |
| 46 | + else: |
| 47 | + print("Welcome to PythOS, ", fname, sname,".") |
| 48 | + print("WARNING: DO NOT CLOSE THIS WINDOW UNTIL PYTHOS SAYS IT IS SAFE TO.") |
| 49 | + return fname |
| 50 | + return sname |
| 51 | + return TryNewDev |
| 52 | +ShutDown = False |
| 53 | +login() |
| 54 | +load() |
| 55 | +# Now PythOS has loaded, we can create the actual operating system. But, we need to make a loop so that you can type in a command and then type in a new one. |
| 56 | + |
| 57 | +while ShutDown == False: |
| 58 | + if TryNewDev == "Y": |
| 59 | + print("PythOS is shutting down so you can try PythOS Developer's Edition. Please wait...") |
| 60 | + sleep(5) |
| 61 | + print("PythOS has shut down. To install the Developer's Edition, please refer to the section titled 'Setup' in the README.md of https://github.com/Captain-Awesome-Jnr/PythOS-Dev-Edition") |
| 62 | + ShutDown = True |
| 63 | + break |
| 64 | + else: |
| 65 | + print() |
| 66 | + print("You can type in commands to use PythOS. You can use commands like:") |
| 67 | + print("power - Brings up power options") |
| 68 | + print("ver - Brings up info about your version of PythOS") |
| 69 | + print("settings - Lets you manage settings") |
| 70 | + print("launch - Opens the App Lancher, where you can open apps") |
| 71 | + UtillityOption = input("Type in your option: ") |
| 72 | + if UtillityOption == "power": |
| 73 | + print("Here are your power options:") |
| 74 | + print("shutdown - Saves your work and lets you close the window.") |
| 75 | + print("#shutdown - Quickly turns off PythOS (Not reccomended).") |
| 76 | + print("sleep - Pauses operations in PythOS and puts it into a low-power mode.") |
| 77 | + PowerOption = input("Type in your option... ") |
| 78 | + if PowerOption == "shutdown": |
| 79 | + print("Logging", fname, sname, """off. This operation may take a while. Don't close this window.""") |
| 80 | + sleep(15) |
| 81 | + print("""Preparing PythOS for safe closure... |
| 82 | +This operation may take a while. Don't close this window.""") |
| 83 | + sleep(20) |
| 84 | + print("""You have reached a point where it is safe to exit PythOS. |
| 85 | +You can now close this window.""") |
| 86 | + ShutDown = True |
| 87 | + break |
| 88 | + elif PowerOption == "#shutdown": |
| 89 | + print("Quick Shutdown initilisation:") |
| 90 | + DoQuickShutdown = (input("Quick Shutdown will imedietly let you close the window. Turn off now? (Y/N): ")) |
| 91 | + if DoQuickShutdown == "Y" or "y": |
| 92 | + print("""PythOS - Shut down sucsessful: |
| 93 | +You can now close this window.""") |
| 94 | + break |
| 95 | + elif DoQuickShutdown == "N" or "n": |
| 96 | + print("Aborting Quick Shutdown.") |
| 97 | + else: |
| 98 | + rerun = input("""There was an error prossesing your request: |
| 99 | +Quick Shutdown inisilisation. Press ENTER to return to main menu.""") |
| 100 | + elif PowerOption == "sleep": |
| 101 | + print("PythOS is currently asleep.") |
| 102 | + ExitSleep = input("Press any key to exit sleep: ") |
| 103 | + if ExitSleep == "": |
| 104 | + print("Welcome back,", fname, sname,".") |
| 105 | + else: |
| 106 | + print("Welcome back", fname, sname,".") |
| 107 | + else: |
| 108 | + rerun = input("Error 1: The power option you have typed is not a proper power option. Press ENTER") |
| 109 | + elif UtillityOption == "ver": |
| 110 | + print("PythOS", PythOS_Ver) |
| 111 | + print("CONFIDETIONAL PROPERTY! If leaked, please email me at captainawesomejnr@outlook.com.au .") |
| 112 | + print("(C) Captainawesomejnr 2022-23. All rights reserved.") |
| 113 | + elif UtillityOption == "settings": |
| 114 | + print("SETTINGS") |
| 115 | + print("Here you can manage settings. Here are the settings you can manage:") |
| 116 | + print("1. Processor type") |
| 117 | + setting = input("Which setting would you like to modify? ") |
| 118 | + if setting == "1": |
| 119 | + print("Select processor type:") |
| 120 | + print("1. 64-bit") |
| 121 | + print("2. 32-bit") |
| 122 | + processor = input("Put in your option: ") |
| 123 | + if processor == "1": |
| 124 | + print("Running PythOS on AMD64") |
| 125 | + ProcessorType = 1 |
| 126 | + if processor == "2": |
| 127 | + print("Running PythOS on x86") |
| 128 | + ProcessorType = 2 |
| 129 | + else: |
| 130 | + rerun = input("Error 3: Processor type selection didn't work. Maybe you made a typo? Press ENTER.") |
| 131 | + else: |
| 132 | + rerun = input("Error 2: Setting not found. Press ENTER (or RETURN, depending on your keyboard)") |
| 133 | + elif UtillityOption == "launch": |
| 134 | + print("App Lancher") |
| 135 | + print("Here you can lanch one of the apps in PythOS. Here are the apps avalible:") |
| 136 | + print("1. Calculator") |
| 137 | + print("2. Don't click the button (*BETA*)") |
| 138 | + print("3. Spy Messages") |
| 139 | + LaunchOption = input("Type in the number of your option: ") |
| 140 | + if LaunchOption == "1": |
| 141 | + CalcFirstNumber = float(input("Type in your first number: ")) |
| 142 | + CalcOperation = input("What operation would you like to use? (* = Times, / = Divided By, ^ = Power) ") |
| 143 | + CalcSecondNumber = float(input("Type in the other number: ")) |
| 144 | + if CalcOperation == "/" and CalcSecondNumber == 0: |
| 145 | + print(CalcFirstNumber, "/ 0: Error processing (Could not divide by 0.)") |
| 146 | + else: |
| 147 | + if CalcOperation == "+": |
| 148 | + print(CalcFirstNumber, "+", CalcSecondNumber, "=", CalcFirstNumber + CalcSecondNumber) |
| 149 | + elif CalcOperation == "-": |
| 150 | + print(CalcFirstNumber, "-", CalcSecondNumber, "=", CalcFirstNumber - CalcSecondNumber) |
| 151 | + elif CalcOperation == "*": |
| 152 | + print(CalcFirstNumber, "*", CalcSecondNumber, "=", CalcFirstNumber * CalcSecondNumber) |
| 153 | + elif CalcOperation == "/": |
| 154 | + print(CalcFirstNumber, "/", CalcSecondNumber, "=", CalcFirstNumber / CalcSecondNumber) |
| 155 | + elif CalcOperation == "^": |
| 156 | + print(CalcFirstNumber,"^",CalcSecondNumber, "=", CalcFirstNumber ** CalcSecondNumber) |
| 157 | + else: |
| 158 | + rerun = input("Error 4: Your calculation could not be processed. Press ENTER.") |
| 159 | + elif LaunchOption == "2": |
| 160 | + import tkinter |
| 161 | + Window = tkinter.Tk() |
| 162 | + Button = tkinter.Button(Window, text="Do not press this button", width=40) |
| 163 | + Button.pack(padx=10, pady=10) |
| 164 | + elif LaunchOption == "3": |
| 165 | + CipherAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 166 | + CipherToEncrypt = input("Please enter a string to encrypt. ") |
| 167 | + CipherToEncrypt = CipherToEncrypt.upper() |
| 168 | + CipherShift = int(input("Please enter a integer (whole number) from 1-25 to be your key")) |
| 169 | + CipherMessage = "" |
| 170 | + for CurrentChar in CipherToEncrypt: |
| 171 | + OldPos = CipherAlphabet.find(CurrentChar) |
| 172 | + NewPos = OldPos + CipherShift |
| 173 | + if CurrentChar in CipherAlphabet: |
| 174 | + CipherMessage = CipherMessage + CipherAlphabet[NewPos] |
| 175 | + else: |
| 176 | + CipherMessage = CipherMessage + CurrentChar |
| 177 | + print("Your encrypted message is", CipherMessage) |
| 178 | + else: |
| 179 | + print("Error 4: App could not be launched.") |
| 180 | + # Below is some fun to make it look like PythOS has been corrupted! |
| 181 | + elif UtillityOption == "$CORRUPT$": |
| 182 | + from random import randint |
| 183 | + CORRUPT_Lines = 0 |
| 184 | + while CORRUPT_Lines <= 60: |
| 185 | + CORRUPT_Letters = randint(1, 3) |
| 186 | + if CORRUPT_Letters == 1: |
| 187 | + print("@@@@@@@@@@@@@@@@@@@@@@@@") |
| 188 | + elif CORRUPT_Letters == 2: |
| 189 | + print("########################") |
| 190 | + else: |
| 191 | + print("$$$$$$$$$$$$$$$$$$$$$$$$") |
| 192 | + CORRUPT_Lines = CORRUPT_Lines + 1 |
| 193 | + |
| 194 | + # Below is even more fun - crashing PythOS. |
| 195 | + elif UtillityOption == "$STOPCRASH$": |
| 196 | + if ProcessorType == 1: |
| 197 | + STOPCRASH_Run = input("""STOP! |
| 198 | +
|
| 199 | +A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation. |
| 200 | +Fatal error cause: User-Activated Fatal Crash |
| 201 | + Code: x64-55-73-65-72 |
| 202 | +You can: |
| 203 | +Press ENTER to terminate the pogram. It is recomended that you do this as it is the most effective fix. |
| 204 | + OR |
| 205 | +Type 'close' to exit PythOS. You should not do this because it will abandon all unsaved data. |
| 206 | +
|
| 207 | +For more information, check the article about STOP! crash screens at https://www.github.com/Captain-Awesome-Jnr |
| 208 | +
|
| 209 | +
|
| 210 | +
|
| 211 | +
|
| 212 | +
|
| 213 | +Type in your option: """) |
| 214 | + if STOPCRASH_Run == "": |
| 215 | + print("Terminating program...") |
| 216 | + sleep(2.5) |
| 217 | + print("Sucsessfully terminated program. Returning to PythOS.") |
| 218 | + else: |
| 219 | + break |
| 220 | + elif ProcessorType == 2: |
| 221 | + STOPCRASH_Run = input("""STOP! |
| 222 | +
|
| 223 | +A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation. |
| 224 | +Fatal error cause: User-Activated Fatal Crash |
| 225 | + Code: x86-55-73-65-72 |
| 226 | +You can: |
| 227 | +Press ENTER to terminate the pogram. It is recomended that you do this as it is the most effective fix. |
| 228 | + OR |
| 229 | +Type 'close' to exit PythOS. You should not do this because it will abandon all unsaved data. |
| 230 | +
|
| 231 | +For more information, check the article about STOP! crash screens at https://www.github.com/Captain-Awesome-Jnr |
| 232 | +
|
| 233 | +
|
| 234 | +
|
| 235 | +
|
| 236 | +
|
| 237 | +Type in your option: """) |
| 238 | + if STOPCRASH_Run == "": |
| 239 | + print("Terminating program...") |
| 240 | + sleep(2.5) |
| 241 | + print("Sucsessfully terminated program. Returning to PythOS.") |
| 242 | + else: |
| 243 | + break |
| 244 | + |
| 245 | + else: |
| 246 | + rerun = input("Error 0: The utillity you have typed is not a proper utillity option. Press ENTER") |
0 commit comments