Try using xonsh: https://xon.sh/ I write all my shell scripts in it (well, at least the ones I don't need to share with coworkers).