Python Programming/Command-line one-liners
Tools
General
Sister projects
In other projects
Python can run one-liners from an operating system command line using option -c:
python-c"print(3.0/2)"
python-c"import math;print(math.sin(1))"
python-c"for i in range(1,11):print(i)"
python-c"for i in range(1,11):for j in range(1,11): print(i,j)"
python-c"for i, j in ((i,j) for i in range (1,11) for j in range(1,11)): print(i, j)"
echohey|python-c"import sys,re;[sys.stdout.write(line) for line in sys.stdin if re.search('he.', line)]"
echohallo|python-c"import sys,re;[sys.stdout.write(re.sub('h[au]llo', 'hello', line)) for line in sys.stdin]"
python-mcalendar
python-c"import playsound as p;p.playsound(r'C:\WINDOWS\Media\notify.wav')"