Update 'shell.py'

This commit is contained in:
JaydenMW 2021-02-14 20:15:47 +01:00
parent 1c475e65f3
commit d3e22d4f0c
1 changed files with 13 additions and 14 deletions

View File

@ -1,5 +1,4 @@
"""pclish: a simple shell written in Python"""
# Import Modules
import os
import subprocess
import psutil
@ -13,7 +12,7 @@ CPU = platform.processor()
# Command Interpretation -- This is the core of the shell
def execute_command(command):
"""execute commands and handle piping"""
# execute commands and handle piping#
try:
if "|" in command:
s_in, s_out = (0, 0)
@ -51,7 +50,7 @@ def execute_command(command):
# Commands - Commands are defined here.
def pclish_cd(path):
"""convert to absolute path and change directory"""
# convert to absolute path and change directory#
try:
os.chdir(os.path.abspath(path))
except Exception:
@ -62,17 +61,17 @@ def pclish_echo():
print(txt)
def pclish_help():
print("""pclish: here are the commands available
print("pclish: here are the commands available
help: shows this page
cd: change directory
ver: displays shell version
ls: lists files in current dir""")
ls: lists files in current dir")
def pclish_ls():
print("""pclish: this feature is not yet supported""")
print("pclish: this feature is not yet supported")
def pclish_ver():
print("""pclish: version 0.0.2a.""")
print("pclish: version 0.0.2a.")
def pclish_mkdir():
value = input("What would you like to name this new directory:\n")
@ -80,7 +79,7 @@ def pclish_mkdir():
os.mkdir(dir)
def pclish_system():
print("""System: XCU Python Based Shell Env""")
print("System: XCU Python Based Shell Env")
print("RAM:")
print(RAM)
print("CPU:")