How to build a new kind of syntax which when has been called run it's value in os.system
while True:
    a=input('enter your direction: ')
    if a!='':
        !dir !+Shell(a)
    else:
        print('the dir can not be None')
How to build a new kind of syntax which when has been called run it's value in os.system
while True:
    a=input('enter your direction: ')
    if a!='':
        !dir !+Shell(a)
    else:
        print('the dir can not be None')
 
    
    Based on your clarification, maybe this would work for you:
import subprocess
while True:
    cmd = input("Enter a command: ")
    if cmd != "":
        cmd = cmd.split("!")[1]
        subprocess.call(cmd, shell=True)
    else:
        print("Input cannot be None")
