Python onliners from terminal

From cod3v
Revision as of 09:44, 10 January 2022 by Mol (talk | contribs) (→‎Theory)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

Use python as a simple calculator. Python is a powerful language which is easy to use.

Theory

Use -c option to use python. Note that print command is necessary. Or use echo -e option to pipe commands to Python compiler.

https://stackoverflow.com/questions/2043453/executing-multi-line-statements-in-the-one-line-command-line