473,614 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is any python like linux shell?

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?

Jan 21 '07 #1
7 2236
Frank Potter wrote:
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

Jan 21 '07 #2

George Sakkis wrote:
Frank Potter wrote:
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
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

- Paddy.

Jan 22 '07 #3
Paddy wrote:
George Sakkis wrote:

>>Frank Potter wrote:

>>>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


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

Jan 22 '07 #4
Frank Potter wrote:
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
Jan 22 '07 #5
Frank Potter wrote:
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.

Jan 22 '07 #6
In article <ep**********@d aisy.noc.ucla.e du>,
James Stroud <js*****@mbi.uc la.eduwrote:
....
Paddy 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. ;)
Careful, someone will think you're serious.
Jan 22 '07 #7
On Sun, 21 Jan 2007 22:10:17 -0800, James Stroud <js*****@mbi.uc la.eduwrote:
Frank Potter wrote:
>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.
....
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

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyn dns.org R'lyeh wgah'nagl fhtagn!
Jan 22 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3836
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or less - during my own installation of Python 2.3 on Fedora Core 1 Linux for a friend of mine). Anyway, HTH, L.
5
1983
by: Ben Finney | last post by:
Howdy all, I'm experimenting with carrying my personal computing environment around on a keychain USB flash storage device. I have the usual suspects on there: SSH keys, GPG keys, program configs. I'm probably not the first to think that a standalone distribution of Python would be a useful thing to have in my back pocket. Finding information on that is proving to be a problem, however.
16
3931
by: John Salerno | last post by:
Hi all. I just installed Ubuntu and I'm learning how to use the bash shell. Aside from the normal commands you can use, I was wondering if it's possible to use Python from the terminal instead of the normal bash commands (e.g. print instead of echo). My main reason for asking is that I like using Python for everything, and if I don't need to learn the bash 'language', then I won't just yet. Thanks.
2
3461
by: enquiring mind | last post by:
-learning python with limited knowledge of linux. -get error msg 21 "file or directory does not exist" -running Suse linux 10. -haven't had a problem before - rebooted several times. -python opened in shell/terminal program Konsole window like this user1@linux!~ - shell - Konsole Sessions View Bookmark Settings Help -first line in window gives me a linux prompt:
3
1465
by: wxPythoner | last post by:
This really looks ugly for an error message: + Stopped python Please explain to me the role of the '+' sign. And why is there such a gap between 'Stopped' and 'python'?
3
3855
by: Gros Bedo | last post by:
Hello :-) I have a question about Python and Linux shell. I have a python program which is permanently resident in the end-user system. I'm currently producing a RPM package, and it works nicely. The problem is that when I uninstall it, my program keeps running in the background, even if the files are deleted. I know I can terminate python shell directly, but this is not a good ideabecause the end-user may be working with another important...
4
7513
by: Stephen Cattaneo | last post by:
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment variable is not in the os.environ dictionary. I know that cron runs in a subshell that does not have all of the normally set environment variables. HOSTNAME is not one of those variables, it is set even in cron's subshell. Why doesn't python get...
3
3941
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I am fairly happy using IDLE, the debugger is unintuitive to me and I wanted a project manager and a better variable/ class browser and also the potential to edit/run other languages such as R and Tex/Latex. Windows and LINUX compatibility is...
8
5577
by: james.kirin39 | last post by:
Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an interactive Python shell on Windows that supports: - easy copy-pasting to/from an editor? (as opposed to the cumbersome "mark", "copy" and then "paste" sequence that any terminal on Windows
0
8130
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.