On Apr 18, 2016 12:30 PM, "Wes Turner" <wes.turner@gmail.com> wrote:

> >
> > I think the users of oneline.py could be people that now write lots of
> > bash scripts and work on the command line. So whenever someone asks a
> > question somewhere about how to do X on the linux command line, we
> > might have the answer: """
> >
> > Q: On the linux commandline, how do I get only the filename from a
> > full path that is in $FILEPATH
> >
> > A: Python has this. You can use the tools in os.path:
> >
> > Filename:
> > $ oneline.py "os.path.basename('$FILEPATH')"
> >
> > Path to directory:
> > $ oneline.py "os.path.dirname('$FILEPATH')"
> > """
>
> FILEPATH='for'"example');"'subprocess.call("cat /etc/passwd", shell=True)'

sys.argv[1]  (IFS=' ')
stdin (~IFS=$'\n')

...

* https://github.com/westurner/dotfiles/blob/develop/scripts/el

* https://github.com/westurner/pyline/blob/master/pyline/pyline.py (considering adding an argument (in addition to the existing -m) for importlib.import_module))

>
> >
> > This might be more appealing than python -c. The whole point is to
> > make Python's power available and visible for a larger audience.
> >
> > -Koos
> > _______________________________________________
> > Python-ideas mailing list
> > Python-ideas@python.org
> > https://mail.python.org/mailman/listinfo/python-ideas
> > Code of Conduct: http://python.org/psf/codeofconduct/