-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from Aydinhamedi/Alpha-b
Alpha b
- Loading branch information
Showing
8 changed files
with
2,611 additions
and
42,498 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import subprocess | ||
import traceback | ||
import sys | ||
import os | ||
# Other | ||
from Data.Utils.print_color_V1_OLD import print_Color | ||
def run_program(file_path): | ||
while True: | ||
try: | ||
try: | ||
# Run the other Python program using subprocess | ||
subprocess.run(["python", file_path], check=True) | ||
except subprocess.CalledProcessError as ERROR_Py: | ||
print_Color("~*An error occurred: \nERROR: ~*" + str(ERROR_Py), ['yellow', 'red'], advanced_mode=True) | ||
print_Color('~*Do you want to see the detailed error message? ~*[~*Y~*/~*n~*]: ', | ||
['yellow', 'normal', 'green', 'normal', 'red', 'normal'], | ||
advanced_mode = True, | ||
print_END='') | ||
show_detailed_error = input('') | ||
if show_detailed_error.lower() == 'y': | ||
print_Color('detailed error message:', ['yellow']) | ||
#print_Color('1th ERROR (FILE ERROR) [!MAIN!]:', ['red']) | ||
print_Color('2th ERROR (subprocess.run ERROR):', ['red']) | ||
traceback.print_exc() | ||
choice = input("Do you want to restart the program? (y/n): ") | ||
if choice.lower() != "y": | ||
break | ||
os.system('cls' if os.name == 'nt' else 'clear') | ||
else: | ||
break | ||
except OSError: | ||
break | ||
run_program('Data\CLI_main.py') |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters