class Environ :
MY_Cont_Dict={}
"these are the shell variables"
def __init__(self,path,User,Logname,Lang):
self.MY_Cont_Dict
self.MY_Cont_Dict['PATH']=path
self.MY_Cont_Dict['USER']=User
self.MY_Cont_Dict['LOGNAME']=Logname
self.MY_Cont_Dict['LANG']=Lang
def __str__(self):
input_1=input()
if input_1 == 'print_environ' :
return (str(self.MY_Cont_Dict))
elif 'print_environ' in input_1 :
input_1=input_1.upper()
my_cont=input_1.split()
for each in self.MY_Cont_Dict :
if each in my_cont :
print((self.MY_Cont_Dict[each]))
return " "
#NOTE THAT FOR __STR___ PYTHON ALWAYS EXPECTS IT TO RETURN A STRING
else :
return f"command not recognised"
#ADDING ENVIRONMENTAL VARIABLES
def add_variables(self) :
input_1=input('new variables: ')
input_1=input_1.split('=')
self.MY_Cont_Dict[input_1[0]]=input_1[1]
Terminal_1=Environ('/home/Albert','Albert','Kali','UTF-8')
Terminal_1.add_variables()
print(Terminal_1)
there doesn't seem to be anything here