How can I use try...except
in a Python one-liner invoked from bash?
python3 -c "try: import foo\nexcept ModuleNotFoundError: print('no foo')"
File "<string>", line 1
try: import foo\nexcept ModuleNotFoundError: print('no foo')
^
SyntaxError: unexpected character after line continuation character