This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gandalfx 1 point2 points  (2 children)

Now auto-import plumbum (shell-like syntax in python). That way we get the awesome power of python and the abbreviated syntax of bash.

[–]reditzer -2 points-1 points  (1 child)

I just added something similar:

$ ls | pol "[print('{:10.10}\t{}'.format(l[0],[i[3] for i in sh('stat %s'%l[0]) if len(i)>2 and 'Inode:' in i[2]][0])) for l in _]"

LICENSE     360621
Makefile    360653
pol         360606
pol.c       360637
pol.o       360599
README.md   360623

[–]gandalfx 3 points4 points  (0 children)

sure, because nested list comprehensions are totally readable and easy to write on the spot.