import pathlib

print(pathlib.Path(__file__).parent.resolve())

while True:
    next_cmd = input("> ")
    print(eval(next_cmd))


[(3, 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), False, 'import pathlib\n')]