import pathlib

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

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


[((3, 6, 3, 28), 'pathlib.Path', 'pathlib.Path', ({(3, 19, 3, 27): '__file__'}, {}), '(__file__)', False, 'import pathlib\n')]