|
| 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 1.0.0: Added PythOS PRO (BETA) |
| 10 | +# To add the wait functionality, we need to import time.sleep. |
| 11 | +from time import sleep |
| 12 | +PythOS_Ver = "Alpha 1.0.0 Xmas Edition" |
| 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 | + else: |
| 39 | + print("Welcome to PythOS. Dev Mode activated.") |
| 40 | + else: |
| 41 | + print("Welcome to PythOS, ", fname, sname,".") |
| 42 | + print("WARNING: DO NOT CLOSE THIS WINDOW UNTIL PYTHOS SAYS IT IS SAFE TO.") |
| 43 | + primt("Also, MERRY XMAS!") |
| 44 | + return fname |
| 45 | + return sname |
| 46 | + return TryNewDev |
| 47 | +ShutDown = False |
| 48 | +login() |
| 49 | +load() |
| 50 | +# 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. |
| 51 | + |
| 52 | +while ShutDown == False: |
| 53 | + if TryNewDev == "Y": |
| 54 | + print("PythOS is shutting down so you can try PythOS Developer's Edition. Please wait...") |
| 55 | + sleep(5) |
| 56 | + 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") |
| 57 | + ShutDown = True |
| 58 | + break |
| 59 | + else: |
| 60 | + print() |
| 61 | + print("You can type in commands to use PythOS. You can use commands like:") |
| 62 | + print("power - Brings up power options") |
| 63 | + print("ver - Brings up info about your version of PythOS") |
| 64 | + print("settings - Lets you manage settings") |
| 65 | + if ActivatedPyPro == True: |
| 66 | + print("pro - Starts the PythOS Pro Workspace") |
| 67 | + print("launch - Opens the App Lancher, where you can open apps") |
| 68 | + UtillityOption = input("Type in your option: ") |
| 69 | + if UtillityOption == "power": |
| 70 | + print("Here are your power options:") |
| 71 | + print("shutdown - Saves your work and lets you close the window.") |
| 72 | + print("#shutdown - Quickly turns off PythOS (Not reccomended).") |
| 73 | + print("sleep - Pauses operations in PythOS and puts it into a low-power mode.") |
| 74 | + PowerOption = input("Type in your option... ") |
| 75 | + if PowerOption == "shutdown": |
| 76 | + print("Logging", fname, sname, """off. |
| 77 | +This operation may take a while. Don't close this window.""") |
| 78 | + sleep(15) |
| 79 | + print("""Preparing PythOS for safe closure... |
| 80 | +This operation may take a while. Don't close this window.""") |
| 81 | + sleep(20) |
| 82 | + print("""You have reached a point where it is safe to exit PythOS. |
| 83 | +You can now close this window.""") |
| 84 | + ShutDown = True |
| 85 | + break |
| 86 | + elif PowerOption == "#shutdown": |
| 87 | + print("Quick Shutdown initilisation:") |
| 88 | + DoQuickShutdown = (input("Quick Shutdown will imedietly let you close the window. Turn off now? (Y/N): ")) |
| 89 | + if DoQuickShutdown == "Y" or "y": |
| 90 | + print("""PythOS - Shut down sucsessful: |
| 91 | +You can now close this window.""") |
| 92 | + break |
| 93 | + elif DoQuickShutdown == "N" or "n": |
| 94 | + print("Aborting Quick Shutdown.") |
| 95 | + else: |
| 96 | + rerun = input("""There was an error prossesing your request: |
| 97 | +Quick Shutdown inisilisation. Press ENTER to return to main menu.""") |
| 98 | + elif PowerOption == "sleep": |
| 99 | + print("PythOS is currently asleep.") |
| 100 | + ExitSleep = input("Press any key to exit sleep: ") |
| 101 | + if ExitSleep == "": |
| 102 | + print("Welcome back,", fname, sname,".") |
| 103 | + else: |
| 104 | + print("Welcome back", fname, sname,".") |
| 105 | + else: |
| 106 | + rerun = input("Error 1: The power option you have typed is not a proper power option. Press ENTER") |
| 107 | + elif UtillityOption == "ver": |
| 108 | + print("PythOS", PythOS_Ver) |
| 109 | + print("CONFIDETIONAL PROPERTY! If leaked, please email me at captainawesomejnr@outlook.com.au .") |
| 110 | + print("(C) Captainawesomejnr 2022-23. All rights reserved.") |
| 111 | + elif UtillityOption == "pro": |
| 112 | + if ActivatedPyPro == False: |
| 113 | + print("Hmmm... It looks like PythOS Pro cannot start.") |
| 114 | + sleep(5) |
| 115 | + if ProcessorType == 1: |
| 116 | + STOPCRASH_Run = input("""STOP! |
| 117 | +
|
| 118 | +A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation. |
| 119 | +Fatal error cause: PythOS Pro could not start. |
| 120 | + Code: x64-01010101-01110011-01100101-01110010 |
| 121 | +You can: |
| 122 | +Press ENTER to terminate the pogram. It is recomended that you do this as it is the most effective fix. |
| 123 | + OR |
| 124 | +Type 'close' to exit PythOS. You should not do this because it will abandon all unsaved data. |
| 125 | +
|
| 126 | +For more information, check the article about STOP! crash screens at https://www.github.com/Captain-Awesome-Jnr |
| 127 | +
|
| 128 | +
|
| 129 | +
|
| 130 | +
|
| 131 | +
|
| 132 | +Type in your option: """) |
| 133 | + if STOPCRASH_Run == "": |
| 134 | + print("Terminating program...") |
| 135 | + sleep(2.5) |
| 136 | + print("Sucsessfully terminated program. Returning to PythOS.") |
| 137 | + else: |
| 138 | + break |
| 139 | + elif ProcessorType == 2: |
| 140 | + STOPCRASH_Run = input("""STOP! |
| 141 | +
|
| 142 | +A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation. |
| 143 | +Fatal error cause: User-Activated Fatal Crash |
| 144 | + Code: x86-01010101-01110011-01100101-01110010 |
| 145 | +You can: |
| 146 | +Press ENTER to terminate the pogram. It is recomended that you do this as it is the most effective fix. |
| 147 | + OR |
| 148 | +Type 'close' to exit PythOS. You should not do this because it will abandon all unsaved data. |
| 149 | +
|
| 150 | +For more information, check the article about STOP! crash screens at https://www.github.com/Captain-Awesome-Jnr |
| 151 | +
|
| 152 | +
|
| 153 | +
|
| 154 | +
|
| 155 | +
|
| 156 | +Type in your option: """) |
| 157 | + if STOPCRASH_Run == "": |
| 158 | + print("Terminating program...") |
| 159 | + sleep(2.5) |
| 160 | + print("Sucsessfully terminated program. Returning to PythOS.") |
| 161 | + else: |
| 162 | + break |
| 163 | + else: |
| 164 | + import PyPRO as pro |
| 165 | + pro.run |
| 166 | + elif UtillityOption == "settings": |
| 167 | + print("SETTINGS") |
| 168 | + print("Here you can manage settings. Here are the settings you can manage:") |
| 169 | + print("1. Processor type") |
| 170 | + print("2. PythOS Pro Activation") |
| 171 | + setting = input("Which setting would you like to modify? ") |
| 172 | + if setting == "1": |
| 173 | + print("Select processor type:") |
| 174 | + print("1. 64-bit") |
| 175 | + print("2. 32-bit") |
| 176 | + processor = input("Put in your option: ") |
| 177 | + if processor == "1": |
| 178 | + print("Running PythOS on AMD64 or x64") |
| 179 | + ProcessorType = 1 |
| 180 | + if processor == "2": |
| 181 | + print("Running PythOS on x86") |
| 182 | + ProcessorType = 2 |
| 183 | + else: |
| 184 | + rerun = input("Error 3: Processor type selection didn't work. Maybe you made a typo? Press ENTER.") |
| 185 | + elif setting == "2": |
| 186 | + print("Here you can manage whether or not you want PythOS Pro.") |
| 187 | + print("WARNING: Do not turn on PythOS Pro unless you have followed the instructions in its README.txt. This can cause PythOS to crash to the extent you need to restart it!!!") |
| 188 | + activatepypro = input("""With PythOS Pro, you can: |
| 189 | +- Use the FIRST PythOS GUI |
| 190 | +- Enjoy games |
| 191 | +and MUCH, MUCH MORE! |
| 192 | +Would you like to turn PythOS Pro on? (Y/N)""") |
| 193 | + if activatepypro == "Y" or "y": |
| 194 | + sleep(0.5) |
| 195 | + ActivatedPyPro = True |
| 196 | + print("PythOS Pro is ready to be used.") |
| 197 | + elif activatepypro == "N" or "n": |
| 198 | + sleep(0.5) |
| 199 | + ActivatedPyPro = False |
| 200 | + print("PythOS Pro has been deactivated. Thank you for trying.") |
| 201 | + else: |
| 202 | + sleep(1.5) |
| 203 | + ActivatedPyPro = False |
| 204 | + print("You did not enter Y or N. For the saftey of PythOS, Pro has been deactivated.") |
| 205 | + else: |
| 206 | + rerun = input("Error 2: Setting not found. Press ENTER") |
| 207 | + elif UtillityOption == "launch": |
| 208 | + print("App Lancher") |
| 209 | + print("Here you can lanch one of the apps in PythOS. Here are the apps avalible:") |
| 210 | + print("1. Calculator") |
| 211 | + print("2. Don't click the button (*BETA*)") |
| 212 | + print("3. Spy Messages") |
| 213 | + LaunchOption = input("Type in the number of your option: ") |
| 214 | + if LaunchOption == "1": |
| 215 | + CalcFirstNumber = float(input("Type in your first number: ")) |
| 216 | + CalcOperation = input("What operation would you like to use? (* = Times, / = Divided By, ^ = Power) ") |
| 217 | + CalcSecondNumber = float(input("Type in the other number: ")) |
| 218 | + if CalcOperation == "/" and CalcSecondNumber == 0: |
| 219 | + print(CalcFirstNumber, "/ 0: Error processing (Could not divide by 0.)") |
| 220 | + else: |
| 221 | + if CalcOperation == "+": |
| 222 | + print(CalcFirstNumber, "+", CalcSecondNumber, "=", CalcFirstNumber + CalcSecondNumber) |
| 223 | + elif CalcOperation == "-": |
| 224 | + print(CalcFirstNumber, "-", CalcSecondNumber, "=", CalcFirstNumber - CalcSecondNumber) |
| 225 | + elif CalcOperation == "*": |
| 226 | + print(CalcFirstNumber, "*", CalcSecondNumber, "=", CalcFirstNumber * CalcSecondNumber) |
| 227 | + elif CalcOperation == "/": |
| 228 | + print(CalcFirstNumber, "/", CalcSecondNumber, "=", CalcFirstNumber / CalcSecondNumber) |
| 229 | + elif CalcOperation == "^": |
| 230 | + print(CalcFirstNumber,"^",CalcSecondNumber, "=", CalcFirstNumber ** CalcSecondNumber) |
| 231 | + else: |
| 232 | + rerun = input("Error 4: Your calculation could not be processed. Press ENTER.") |
| 233 | + elif LaunchOption == "2": |
| 234 | + import tkinter |
| 235 | + Window = tkinter.Tk() |
| 236 | + Button = tkinter.Button(Window, text="Do not press this button", width=40) |
| 237 | + Button.pack(padx=10, pady=10) |
| 238 | + elif LaunchOption == "3": |
| 239 | + CipherAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 240 | + CipherToEncrypt = input("Please enter a string to encrypt. ") |
| 241 | + CipherToEncrypt = CipherToEncrypt.upper() |
| 242 | + CipherShift = int(input("Please enter a integer (whole number) from 1-25 to be your key")) |
| 243 | + CipherMessage = "" |
| 244 | + for CurrentChar in CipherToEncrypt: |
| 245 | + OldPos = CipherAlphabet.find(CurrentChar) |
| 246 | + NewPos = OldPos + CipherShift |
| 247 | + if CurrentChar in CipherAlphabet: |
| 248 | + CipherMessage = CipherMessage + CipherAlphabet[NewPos] |
| 249 | + else: |
| 250 | + CipherMessage = CipherMessage + CurrentChar |
| 251 | + print("Your encrypted message is", CipherMessage) |
| 252 | + else: |
| 253 | + print("Error 4: App could not be launched.") |
| 254 | + # Below is some fun to make it look like PythOS has been corrupted! |
| 255 | + elif UtillityOption == "$CORRUPT$": |
| 256 | + from random import randint |
| 257 | + CORRUPT_Lines = 0 |
| 258 | + while CORRUPT_Lines <= 60: |
| 259 | + CORRUPT_Letters = randint(1, 3) |
| 260 | + if CORRUPT_Letters == 1: |
| 261 | + print("@@@@@@@@@@@@@@@@@@@@@@@@") |
| 262 | + elif CORRUPT_Letters == 2: |
| 263 | + print("########################") |
| 264 | + else: |
| 265 | + print("$$$$$$$$$$$$$$$$$$$$$$$$") |
| 266 | + CORRUPT_Lines = CORRUPT_Lines + 1 |
| 267 | + |
| 268 | + # Below is even more fun - crashing PythOS. |
| 269 | + elif UtillityOption == "$STOPCRASH$": |
| 270 | + if ProcessorType == 1: |
| 271 | + STOPCRASH_Run = input("""STOP! |
| 272 | +
|
| 273 | +A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation. |
| 274 | +Fatal error cause: User-Activated Fatal Crash |
| 275 | + Code: x64-01010101-01110011-01100101-01110010 |
| 276 | +You can: |
| 277 | +Press ENTER to terminate the pogram. It is recomended that you do this as it is the most effective fix. |
| 278 | + OR |
| 279 | +Type 'close' to exit PythOS. You should not do this because it will abandon all unsaved data. |
| 280 | +
|
| 281 | +For more information, check the article about STOP! crash screens at https://www.github.com/Captain-Awesome-Jnr |
| 282 | +
|
| 283 | +
|
| 284 | +
|
| 285 | +
|
| 286 | +
|
| 287 | +Type in your option: """) |
| 288 | + if STOPCRASH_Run == "": |
| 289 | + print("Terminating program...") |
| 290 | + sleep(2.5) |
| 291 | + print("Sucsessfully terminated program. Returning to PythOS.") |
| 292 | + else: |
| 293 | + break |
| 294 | + elif ProcessorType == 2: |
| 295 | + STOPCRASH_Run = input("""STOP! |
| 296 | +
|
| 297 | +A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation. |
| 298 | +Fatal error cause: User-Activated Fatal Crash |
| 299 | + Code: x86-01010101-01110011-01100101-01110010 |
| 300 | +You can: |
| 301 | +Press ENTER to terminate the pogram. It is recomended that you do this as it is the most effective fix. |
| 302 | + OR |
| 303 | +Type 'close' to exit PythOS. You should not do this because it will abandon all unsaved data. |
| 304 | +
|
| 305 | +For more information, check the article about STOP! crash screens at https://www.github.com/Captain-Awesome-Jnr |
| 306 | +
|
| 307 | +
|
| 308 | +
|
| 309 | +
|
| 310 | +
|
| 311 | +Type in your option: """) |
| 312 | + if STOPCRASH_Run == "": |
| 313 | + print("Terminating program...") |
| 314 | + sleep(2.5) |
| 315 | + print("Sucsessfully terminated program. Returning to PythOS.") |
| 316 | + else: |
| 317 | + break |
| 318 | + elif UtillityOption == "$KILL$": |
| 319 | + break |
| 320 | + else: |
| 321 | + rerun = input("Error 0: The utillity you have typed is not a proper utillity option. Press ENTER") |
0 commit comments