This repository was archived by the owner on Nov 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
2+ import subprocess
3+ import sys
24
3- def exit ():
5+ def exit_app ():
46 # Path to the kernel script in the KERNEL folder
57 kernel_script = os .path .join (os .getcwd (), 'KERNEL' , 'kernel.py' )
68
@@ -14,11 +16,11 @@ def exit():
1416 except Exception as e :
1517 print (f"An unexpected error occurred: { e } " )
1618 else :
17- print ("yay! sucsess! " )
19+ print ("Kernel script not found. Make sure 'kernel.py' exists in the 'KERNEL' directory. " )
1820
1921def create_file (filename ):
2022 with open (filename , 'w' ) as file :
21- content = input ("Enter content for the file (end with an empty line):\n " )
23+ print ("Enter content for the file (end with an empty line):" )
2224 while True :
2325 line = input ()
2426 if line == "" :
@@ -37,7 +39,7 @@ def read_file(filename):
3739def edit_file (filename ):
3840 if os .path .isfile (filename ):
3941 with open (filename , 'a' ) as file :
40- content = input ("Enter content to append to the file (end with an empty line):\n " )
42+ print ("Enter content to append to the file (end with an empty line):" )
4143 while True :
4244 line = input ()
4345 if line == "" :
@@ -62,7 +64,8 @@ def main():
6264 edit_file (filename )
6365 elif command == "exit" :
6466 print ("Exiting TextApp. Goodbye!" )
65- exit ()
67+ exit_app ()
68+ break # Add this line to actually exit the loop
6669 else :
6770 print ("Invalid command. Please enter 'create', 'read', 'edit', or 'exit'." )
6871
You can’t perform that action at this time.
0 commit comments