Skip to content

Commit bc201a1

Browse files
Add files via upload
1 parent 7bf669f commit bc201a1

1 file changed

Lines changed: 120 additions & 106 deletions

File tree

PythOS.py

Lines changed: 120 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
Created on Sun Aug 29 13:08:33 2021
55
6-
@author: Charlie K.'Captain Awesome Junior"
6+
@author: Charlie K.'Captain Awesome Junior'
77
"""
88

99
# Changes in PythOS Indev 2.1.0: Added a logout option.
@@ -16,6 +16,7 @@
1616
print("Running PythOS on AMD64")
1717
fname = ""
1818
sname = ""
19+
TryNewDev = ""
1920
def login():
2021
print()
2122
global fname
@@ -24,75 +25,88 @@ def login():
2425
sname = input("Type in your surname: ")
2526
print()
2627
print()
27-
def load(fname, sname):
28+
def load():
2829
print("Loading PythOS. Please wait...")
30+
global TryNewDev
2931
if fname == "admin" and sname == "admin":
3032
print("Welcome to PythOS. You currently have admin permisions")
3133
if fname == "Test" and sname == "123":
32-
print("Welcome to PythOS. Dev Mode activated.")
34+
TryNewDev = input("Developers should try the new PythOS Developer's Edition. Would you like to exit PythOS to run it?(Y/N):")
35+
if TryNewDev == "Y":
36+
print("Just a sec... ")
37+
else:
38+
print("Welcome to PythOS. Dev Mode activated.")
3339
else:
3440
print("Welcome to PythOS, ", fname, sname,".")
3541
print("WARNING: DO NOT CLOSE THIS WINDOW UNTIL PYTHOS SAYS IT IS SAFE TO.")
3642
return fname
3743
return sname
44+
return TryNewDev
3845
ShutDown = False
3946
login()
4047
load()
4148
# 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.
4249

4350
while ShutDown == False:
4451

45-
print()
46-
print("You can type in commands to use PythOS. You can use commands like:")
47-
print("power - Brings up power options")
48-
print("ver - Brings up info about your version of PythOS")
49-
print("settings - Lets you manage settings")
50-
print("launch - Opens the App Lancher, where you can open apps")
51-
UtillityOption = input("Type in your option: ")
52-
if UtillityOption == "power":
53-
print("Here are your power options:")
54-
print("shutdown - Saves your work and lets you close the window.")
55-
print("#shutdown - Quickly turns off PythOS (Not reccomended).")
56-
print("sleep - Pauses operations in PythOS and puts it into a low-power mode.")
57-
PowerOption = input("Type in your option... ")
58-
if PowerOption == "shutdown":
59-
print("Logging", fname, sname, """off.
52+
print(TryNewDev)
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+
print("launch - Opens the App Lancher, where you can open apps")
66+
UtillityOption = input("Type in your option: ")
67+
if UtillityOption == "power":
68+
print("Here are your power options:")
69+
print("shutdown - Saves your work and lets you close the window.")
70+
print("#shutdown - Quickly turns off PythOS (Not reccomended).")
71+
print("sleep - Pauses operations in PythOS and puts it into a low-power mode.")
72+
PowerOption = input("Type in your option... ")
73+
if PowerOption == "shutdown":
74+
print("Logging", fname, sname, """off.
6075
This operation may take a while. Don't close this window.""")
61-
sleep(15)
62-
print("""Preparing PythOS for safe closure...
76+
sleep(15)
77+
print("""Preparing PythOS for safe closure...
6378
This operation may take a while. Don't close this window.""")
64-
sleep(20)
65-
print("""You have reached a point where it is safe to exit PythOS.
66-
You can now close this window.""")
67-
ShutDown = True
68-
break
69-
elif PowerOption == "#shutdown":
70-
print("Quick Shutdown initilisation:")
71-
DoQuickShutdown = (input("Quick Shutdown will imedietly let you close the window. Turn off now? (Y/N): "))
72-
if DoQuickShutdown == "Y" or "y":
73-
print("""PythOS - Shut down sucsessful:
79+
sleep(20)
80+
print("""You have reached a point where it is safe to exit PythOS.
7481
You can now close this window.""")
82+
ShutDown = True
7583
break
76-
elif DoQuickShutdown == "N" or "n":
77-
print("Aborting Quick Shutdown.")
78-
else:
79-
rerun = input("""There was an error prossesing your request:
84+
elif PowerOption == "#shutdown":
85+
print("Quick Shutdown initilisation:")
86+
DoQuickShutdown = (input("Quick Shutdown will imedietly let you close the window. Turn off now? (Y/N): "))
87+
if DoQuickShutdown == "Y" or "y":
88+
print("""PythOS - Shut down sucsessful:
89+
You can now close this window.""")
90+
break
91+
elif DoQuickShutdown == "N" or "n":
92+
print("Aborting Quick Shutdown.")
93+
else:
94+
rerun = input("""There was an error prossesing your request:
8095
Quick Shutdown inisilisation. Press ENTER to return to main menu.""")
81-
elif PowerOption == "sleep":
82-
print("PythOS is currently asleep.")
83-
ExitSleep = input("Press any key to exit sleep: ")
84-
if ExitSleep == "":
85-
print("Welcome back,", fname, sname,".")
96+
elif PowerOption == "sleep":
97+
print("PythOS is currently asleep.")
98+
ExitSleep = input("Press any key to exit sleep: ")
99+
if ExitSleep == "":
100+
print("Welcome back,", fname, sname,".")
101+
else:
102+
print("Welcome back", fname, sname,".")
86103
else:
87-
print("Welcome back", fname, sname,".")
88-
else:
89-
rerun = input("Error 1: The power option you have typed is not a proper power option. Press ENTER")
90-
elif UtillityOption == "ver":
91-
print("PythOS", PythOS_Ver)
92-
print("CONFIDETIONAL PROPERTY! If leaked, please email me at captainawesomejnr@outlook.com.au .")
93-
print("(C) Captainawesomejnr 2022. All rights reserved.")
94-
95-
elif UtillityOption == "settings":
104+
rerun = input("Error 1: The power option you have typed is not a proper power option. Press ENTER")
105+
elif UtillityOption == "ver":
106+
print("PythOS", PythOS_Ver)
107+
print("CONFIDETIONAL PROPERTY! If leaked, please email me at captainawesomejnr@outlook.com.au .")
108+
print("(C) Captainawesomejnr 2022. All rights reserved.")
109+
elif UtillityOption == "settings":
96110
print("SETTINGS")
97111
print("Here you can manage settings. Here are the settings you can manage:")
98112
print("1. Processor type")
@@ -112,14 +126,14 @@ def load(fname, sname):
112126
rerun = input("Error 3: Processor type selection didn't work. Maybe you made a typo? Press ENTER.")
113127
else:
114128
rerun = input("Error 2: Setting not found. Press ENTER")
115-
elif UtillityOption == "launch":
116-
print("App Lancher")
117-
print("Here you can lanch one of the apps in PythOS. Here are the apps avalible:")
118-
print("1. Calculator")
119-
print("2. Don't click the button (*BETA*)")
120-
print("3. Spy Messages")
121-
LaunchOption = input("Type in the number of your option: ")
122-
if LaunchOption == "1":
129+
elif UtillityOption == "launch":
130+
print("App Lancher")
131+
print("Here you can lanch one of the apps in PythOS. Here are the apps avalible:")
132+
print("1. Calculator")
133+
print("2. Don't click the button (*BETA*)")
134+
print("3. Spy Messages")
135+
LaunchOption = input("Type in the number of your option: ")
136+
if LaunchOption == "1":
123137
CalcFirstNumber = float(input("Type in your first number: "))
124138
CalcOperation = input("What operation would you like to use? (* = Times, / = Divided By, ^ = Power) ")
125139
CalcSecondNumber = float(input("Type in the other number: "))
@@ -138,45 +152,45 @@ def load(fname, sname):
138152
print(CalcFirstNumber,"^",CalcSecondNumber, "=", CalcFirstNumber ** CalcSecondNumber)
139153
else:
140154
rerun = input("Error 4: Your calculation could not be processed. Press ENTER.")
141-
elif LaunchOption == "2":
142-
import tkinter
143-
Window = tkinter.Tk()
144-
Button = tkinter.Button(Window, text="Do not press this button", width=40)
145-
Button.pack(padx=10, pady=10)
146-
elif LaunchOption == "3":
147-
CipherAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
148-
CipherToEncrypt = input("Please enter a string to encrypt. ")
149-
CipherToEncrypt = CipherToEncrypt.upper()
150-
CipherShift = int(input("Please enter a integer (whole number) from 1-25 to be your key"))
151-
CipherMessage = ""
152-
for CurrentChar in CipherToEncrypt:
153-
OldPos = CipherAlphabet.find(CurrentChar)
154-
NewPos = OldPos + CipherShift
155-
if CurrentChar in CipherAlphabet:
156-
CipherMessage = CipherMessage + CipherAlphabet[NewPos]
157-
else:
158-
CipherMessage = CipherMessage + CurrentChar
159-
print("Your encrypted message is", CipherMessage)
160-
else:
161-
print("Error 4: App could not be launched.")
162-
# Below is some fun to make it look like PythOS has been corrupted!
163-
elif UtillityOption == "$CORRUPT$":
164-
from random import randint
165-
CORRUPT_Lines = 0
166-
while CORRUPT_Lines <= 60:
167-
CORRUPT_Letters = randint(1, 3)
168-
if CORRUPT_Letters == 1:
169-
print("@@@@@@@@@@@@@@@@@@@@@@@@")
170-
elif CORRUPT_Letters == 2:
171-
print("########################")
155+
elif LaunchOption == "2":
156+
import tkinter
157+
Window = tkinter.Tk()
158+
Button = tkinter.Button(Window, text="Do not press this button", width=40)
159+
Button.pack(padx=10, pady=10)
160+
elif LaunchOption == "3":
161+
CipherAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
162+
CipherToEncrypt = input("Please enter a string to encrypt. ")
163+
CipherToEncrypt = CipherToEncrypt.upper()
164+
CipherShift = int(input("Please enter a integer (whole number) from 1-25 to be your key"))
165+
CipherMessage = ""
166+
for CurrentChar in CipherToEncrypt:
167+
OldPos = CipherAlphabet.find(CurrentChar)
168+
NewPos = OldPos + CipherShift
169+
if CurrentChar in CipherAlphabet:
170+
CipherMessage = CipherMessage + CipherAlphabet[NewPos]
171+
else:
172+
CipherMessage = CipherMessage + CurrentChar
173+
print("Your encrypted message is", CipherMessage)
172174
else:
173-
print("$$$$$$$$$$$$$$$$$$$$$$$$")
174-
CORRUPT_Lines = CORRUPT_Lines + 1
175+
print("Error 4: App could not be launched.")
176+
# Below is some fun to make it look like PythOS has been corrupted!
177+
elif UtillityOption == "$CORRUPT$":
178+
from random import randint
179+
CORRUPT_Lines = 0
180+
while CORRUPT_Lines <= 60:
181+
CORRUPT_Letters = randint(1, 3)
182+
if CORRUPT_Letters == 1:
183+
print("@@@@@@@@@@@@@@@@@@@@@@@@")
184+
elif CORRUPT_Letters == 2:
185+
print("########################")
186+
else:
187+
print("$$$$$$$$$$$$$$$$$$$$$$$$")
188+
CORRUPT_Lines = CORRUPT_Lines + 1
175189

176190
# Below is even more fun - crashing PythOS.
177-
elif UtillityOption == "$STOPCRASH$":
178-
if ProcessorType == 1:
179-
STOPCRASH_Run = input("""STOP!
191+
elif UtillityOption == "$STOPCRASH$":
192+
if ProcessorType == 1:
193+
STOPCRASH_Run = input("""STOP!
180194
181195
A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation.
182196
Fatal error cause: User-Activated Fatal Crash
@@ -193,14 +207,14 @@ def load(fname, sname):
193207
194208
195209
Type in your option: """)
196-
if STOPCRASH_Run == "":
197-
print("Terminating program...")
198-
sleep(2.5)
199-
print("Sucsessfully terminated program. Returning to PythOS.")
200-
else:
210+
if STOPCRASH_Run == "":
211+
print("Terminating program...")
212+
sleep(2.5)
213+
print("Sucsessfully terminated program. Returning to PythOS.")
214+
else:
201215
break
202-
elif ProcessorType == 2:
203-
STOPCRASH_Run = input("""STOP!
216+
elif ProcessorType == 2:
217+
STOPCRASH_Run = input("""STOP!
204218
205219
A fatal error has occured and PythOS could not keep running. Due to this, PythOS was shut down to prevent damage to your installation.
206220
Fatal error cause: User-Activated Fatal Crash
@@ -217,12 +231,12 @@ def load(fname, sname):
217231
218232
219233
Type in your option: """)
220-
if STOPCRASH_Run == "":
221-
print("Terminating program...")
222-
sleep(2.5)
223-
print("Sucsessfully terminated program. Returning to PythOS.")
224-
else:
234+
if STOPCRASH_Run == "":
235+
print("Terminating program...")
236+
sleep(2.5)
237+
print("Sucsessfully terminated program. Returning to PythOS.")
238+
else:
225239
break
226240

227-
else:
228-
rerun = input("Error 0: The utillity you have typed is not a proper utillity option. Press ENTER")
241+
else:
242+
rerun = input("Error 0: The utillity you have typed is not a proper utillity option. Press ENTER")

0 commit comments

Comments
 (0)