console clears after sucsessful setup

This commit is contained in:
0ceanSlim 2023-11-09 11:29:15 -05:00
parent f9893b6506
commit 68c95663c2

15
cli.py
View File

@ -3,6 +3,13 @@ import json
import subprocess import subprocess
import sys import sys
def clear_console():
# Clear console based on the operating system
if os.name == 'nt': # For Windows
os.system('cls')
else: # For Unix/Linux/Mac
os.system('clear')
def check_python_installation(): def check_python_installation():
try: try:
python_version = subprocess.check_output( python_version = subprocess.check_output(
@ -67,6 +74,7 @@ def main():
subprocess.run(["pip", "install", "-r", "requirements.txt"]) subprocess.run(["pip", "install", "-r", "requirements.txt"])
while not check_rpc_config(): while not check_rpc_config():
clear_console()
print("RPC config file not found.") print("RPC config file not found.")
user_input = input( user_input = input(
"Do you have credentials for your Elements node RPC (yes/no)? " "Do you have credentials for your Elements node RPC (yes/no)? "
@ -84,10 +92,11 @@ def main():
print("You are ready to proceed.") print("You are ready to proceed.")
print("\nElements Python Command Line Interface")
help()
while True: while True:
clear_console()
print("\nElements Python Command Line Interface")
help()
user_input = input("Enter a command: ") user_input = input("Enter a command: ")
if user_input.lower() == 'exit': if user_input.lower() == 'exit':