using python at the bash shell?

cga2000 cga2000 at optonline.net
Tue Aug 15 16:34:09 EDT 2006


On Tue, Aug 08, 2006 at 12:22:42PM EDT, Simon Forman wrote:
> John Salerno wrote:
> > skip at pobox.com wrote:
> > >     John> Aside from the normal commands you can use, I was wondering if
> > >     John> it's possible to use Python from the terminal instead of the
> > >     John> normal bash commands (e.g. print instead of echo).
> > >
> > > Take a look at ipython <http://ipython.scipy.org/>.  It's not precisely what
> > > you've asked for, but it provides some features that help integrate Python
> > > with the shell environment.
> > >
> > > Skip
> >
> > Can you use IPython to do normal bash things, like installing, etc.?
> 
> "normal bash things"? :-)  Yes, most commands can be run by putting an
> '!' before them.  If you ever need to run something that for some
> reason doesn't work with this, you can always run !bash and do it in
> bash.  :-)
> 
Sorry, I'm late with my howmework .. but this is rather cool.

Although .. prefixing all your "system commands" with the far-to-reach
"!" would probably become a royal pain after a while.

Why do you write "most commands" .. what type of command might not be
run by "putting '!' before them?"

In the linux world it would be rather interesting if a distro was
available that uses nothing but python. 

The installer .. the startup scripts .. utilities .. etc.

Maybe there is such a thing and I'm just not aware of it?

Since it would be byt-code being executed it would be faster than
regular shell stuff and a lot easier to customize/maintain.

Don't know enough to figure out if such a thing is possible, though ..

Thanks

cga



More information about the Python-list mailing list