Is any python like linux shell?

F

Frank Potter

I learned some python in windows.
And now I've turned to linux.
I read a book and it teaches how to write shell script with bash,
but I don't feel like the grammar of bash.
Since I know about python,
I want to get a linux shell which use python grammar.
I searched by google and I found pysh, which is not maintained any
more.
There's another script named pyshell, which is not likely what I'm
searching for.
So, will somebody please tell me if there are any python like shells
for linux?
 
G

George Sakkis

Frank said:
I learned some python in windows.
And now I've turned to linux.
I read a book and it teaches how to write shell script with bash,
but I don't feel like the grammar of bash.
Since I know about python,
I want to get a linux shell which use python grammar.
I searched by google and I found pysh, which is not maintained any
more.
There's another script named pyshell, which is not likely what I'm
searching for.
So, will somebody please tell me if there are any python like shells
for linux?

IPython is actually more than a simple shell. Give it a try:
http://ipython.scipy.org/.

George
 
J

James Stroud

Paddy said:
George Sakkis wrote:




Frank,
IPython is great, but it is not a replacement for a shell like bash. If
you have a Linux system then you still need to know the rudiments of
bash

Or better yet, csh. ;)

James
 
J

James Stroud

Frank said:
I learned some python in windows.
And now I've turned to linux.
I read a book and it teaches how to write shell script with bash,
but I don't feel like the grammar of bash.
Since I know about python,
I want to get a linux shell which use python grammar.
I searched by google and I found pysh, which is not maintained any
more.
There's another script named pyshell, which is not likely what I'm
searching for.
So, will somebody please tell me if there are any python like shells
for linux?

Best is to do simple things (ls, mv, rm, cp) via bash or tcsh and to use
python for things of any greater complexity (even slightly more complex).

My strongest advice would be to let go of the idea of "shell scripting"
altogether and begin to write programs built from libraries to solve
your problems. The mere act of beginning to write a shell script (in,
say, bash) will tie you to that "language", even when you realize your
task was much more complex than you had originally imagined. It has
happened to me time and time again.

James
 
R

Russ

Frank said:
I learned some python in windows.
And now I've turned to linux.
I read a book and it teaches how to write shell script with bash,
but I don't feel like the grammar of bash.
Since I know about python,
I want to get a linux shell which use python grammar.
I searched by google and I found pysh, which is not maintained any
more.
There's another script named pyshell, which is not likely what I'm
searching for.
So, will somebody please tell me if there are any python like shells
for linux?

You could in principle use Python as a general-purpose interactive
shell, but it wouldn't make much sense. Bash is more convenient for
basic operations such as changing directories, listing directories,
copying files, etc.

For more advanced scripting, I use both bash and Python. I use bash
typically as an executive for scripting Python programs. For example, I
use bash for stepping through a list of directories and running a set
of python programs in each directory. Sure, I could use Python for the
whole thing, but simply starting programs and moving files around is
more straightforward in bash than in Python.
 
J

Jorgen Grahn

....

My strongest advice would be to let go of the idea of "shell scripting"
altogether and begin to write programs built from libraries to solve
your problems.

Shell scripting is "building from libraries". In this case, other
executables are the libraries.
The mere act of beginning to write a shell script (in,
say, bash) will tie you to that "language",

In what way is shell scripting different from Python scripting here?
even when you realize your
task was much more complex than you had originally imagined. It has
happened to me time and time again.

Opinions differ, of course.

Me, I don't hesitate to write Bourne shell scripts when that seems like the
straightforward idea. Then it's my responsibility to move to something else
-- usually Python -- if the problem grows out of its language. (And I have
to admit, I don't let it grow very complex before I make that choice,
because I don't known Bourne shell that well.)

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top