New submission from Raymond Hettinger <raymond.hettin...@gmail.com>:

It would be nice to write this:

    $ python -c 'from math import *' 'print(e**(1j * pi))'

Instead of this:

    $ python -c 'from math import *; print(e**(1j * pi))'
    (-1+1.22464679915e-16j)

That would also make it possible input an indented block:

    $ python -c 'with open("somefile.txt") as f:'  '  s = f.read()' '  
print(len(s))'

This feature would be especially useful in bash scripts.

FWIW, the timeit module already supports this convenience:

    $ python -m timeit -s 'from math import sqrt' -s 'x = 5' 'y = x ** 2' 'z = 
sqrt(y)'
    10000000 loops, best of 3: 0.0819 usec per loop

----------
components: Interpreter Core
messages: 368454
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Modify -c command-line option to accept multiple inputs
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40568>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to