It converts a given script to properly indented Python code and executes it. If a single expression is given it simply eval it and displays the the retuen value.
Flávio Coelhosays:
You can do loops in the form of list comprehensions.
import sys,os,re,fileinput;a=[i[2] for i in os.walk(‘.’) if i[2]] [0];[sys.stdout.write(re.sub(‘at’,’op’,j)) for j in fileinput(a,inplace=1)]
Careful with this one though, it will edit files on your path without prompt!
Cheers!
parry_allsays:
You can do this:
for i in [1, 2, 3, 4, 5]: print(i)
danasays:
or this way..
python -c $'import os\nfor i in os.listdir("."): print i'
PyOne>
It converts a given script to properly indented Python code and executes it. If a single expression is given it simply eval it and displays the the retuen value.
You can do loops in the form of list comprehensions.
import sys,os,re,fileinput;a=[i[2] for i in os.walk(‘.’) if i[2]] [0];[sys.stdout.write(re.sub(‘at’,’op’,j)) for j in fileinput(a,inplace=1)]
Careful with this one though, it will edit files on your path without prompt!
Cheers!
You can do this:
for i in [1, 2, 3, 4, 5]: print(i)
or this way..
python -c $'import os\nfor i in os.listdir("."): print i'