Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Experimental Python-based shell

Reply
Thread Tools

Experimental Python-based shell

 
 
Jonathan Hayward
Guest
Posts: n/a
 
      10-02-2012
I've made an experimental Python-based Unix/Linux shell at:

http://JonathansCorner.com/cjsh/

An experimental Unix/Linux command line shell, implemented in Python 3, that takes advantage of some more recent concepts in terms of usability and searching above pinpointing files in heirarchies.

I invite you to try it.

Jonathan Hayward, http://www.velocityreviews.com/forums/(E-Mail Removed), JonathansCorner.com
 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      10-03-2012
On Tue, 2012-10-02, Jonathan Hayward wrote:
> I've made an experimental Python-based Unix/Linux shell at:
>
> http://JonathansCorner.com/cjsh/
>
> An experimental Unix/Linux command line shell, implemented in Python
> 3, that takes advantage of some more recent concepts in terms of
> usability and searching above pinpointing files in heirarchies.
>
> I invite you to try it.


Hard to do without a manual page, or any documentation at all except
for a tiny "hello world"-style example ...

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
 
Terry Reedy
Guest
Posts: n/a
 
      10-03-2012
Indexing Python code is ugly. I suggest prefixing non-Python with $.

On 10/3/2012 1:24 PM, Jonathan Hayward wrote:
> I am open to suggestions and patches. I don't think the syntax strange,
> though: it offers a clear and distinct way to differentiate Python and
> shell commands, and shell commands can access Python variables when
> specified. And it is a simple rule, without footnotes needed.


--
Terry Jan Reedy

 
Reply With Quote
 
Prasad, Ramit
Guest
Posts: n/a
 
      10-04-2012
(A little quoting manipulation to make it easier to read with
appropriate context.)


> > On Wed, Oct 3, 2012 at 11:25 AM, Amirouche Boubekki <(E-Mail Removed)> wrote:
> >

> 2012/10/3Jonathan Hayward <(E-Mail Removed)>

> > > The chief benefit besides the searching, so far, is that you can use Py3k mixed with shell commands as the
> > > scripting language--so script in Python instead of bash.
> > >
> > > When using Python for scripting, Pythonlines are indented by an extra tab (or four spaces) while shell-like
> > > commands are not indented. So:

>

> > > cjsh> * * forindex in range(10):
> > > ----> echo %(index)d
> > > ---->
> > > 0
> > > 1
> > > 2

[snip]

> >

> > > Echo could (and maybe should) be a built-in, but it isn't. The output is os.system()'ed to bash, which echoes
> > > based on a command that includes the value of a Python variable. The implementation is a bit crude, but itis

> > reasonably powerful.

> > >
> > > I have other things on the agenda, like making it able to run scripts and doing fuzzy matching, but for now
> > > those are the main two attractions.

> >


> > Is it possible to drop completly the bash syntax and use some python library (I saw it on github) that wraps
> > bash commands with python functions or the other around making it possible to call python functions with a bash-
> > like syntax. The syntax you are talking about seems strange.
> >
> > Regards,
> >
> > Amirouche


Jonathan Hayward wrote:

> I am open to suggestions and patches. I don't think the syntax strange, though: it offers a clear and distinct
> way to differentiate Python and shell commands, and shell commands can access Python variables when specified.
> And it is a simple rule, without footnotes needed.


I need more footnotes. Does every shell command not have indentation?
How can you tell if the shell command is supposed to be in the loop or after
the loop?

for index in range(10):
# do something
echo %(index)d

Is the above equivalent to Python pseudo-code solutionA or B?

Solution A,
for index in range(10):
#do something
Popen('echo', file_path)

Solution B,
for index in range(10):
#do something
Popen('echo', file_path)

How do I make achieve the other solution?


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracyand completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
Reply With Quote
 
Terry Reedy
Guest
Posts: n/a
 
      10-05-2012
On 10/3/2012 4:22 PM, Terry Reedy wrote:
> Indexing Python code is ugly. I suggest prefixing non-Python with $.


Indenting, meaning indenting the Python header lines but not non-Python
lines.

> On 10/3/2012 1:24 PM, Jonathan Hayward wrote:
>> I am open to suggestions and patches. I don't think the syntax strange,
>> though: it offers a clear and distinct way to differentiate Python and
>> shell commands, and shell commands can access Python variables when
>> specified. And it is a simple rule, without footnotes needed.

>



--
Terry Jan Reedy

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED ADVICE--- EXPERIMENTAL VIDEO TAPE George Hammond DVD Video 6 10-13-2005 05:20 PM
XML for time trace experimental data Phony Account XML 2 12-03-2004 11:17 PM
ot: please test my experimental site picayunish HTML 22 12-28-2003 11:01 PM
(cross from alt.comp.lang.c) Experimental exception handliong in C Zygmunt Krynicki C Programming 11 09-22-2003 03:09 PM
ANN: eGenix.com mx Experimental Package 0.8.0 M.-A. Lemburg Python 0 08-12-2003 12:19 PM



Advertisments