Skip to content

Commit c8aec31

Browse files
Add files via upload
1 parent ff9dc16 commit c8aec31

File tree

1 file changed

+240
-0
lines changed

1 file changed

+240
-0
lines changed

PythOS Tempoary copy.py

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

0 commit comments

Comments
 (0)