you can run python code like eval with python command:
eval
python
$code = 'print("hello world from python")' python($code)
output:
hello world from python