How to Execute Multiple Lines in a Single Line Python From Command-Line?
Summary: To make a Python one-liner out of any multi-line Python script, replace the new lines with a new line character ‘\n’ and pass the result into the exec(…) function. You can run this script from the outside (command line, shell, terminal) by using the command python -c “exec(…)”. Problem: Given a multi-line code script … Read more