Experimental Python-based shell

Discussion in 'Python' started by Jonathan Hayward, Oct 3, 2012.

  1. 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, , JonathansCorner.com
     
    Jonathan Hayward, Oct 3, 2012
    #1
    1. Advertising

  2. Jonathan Hayward

    Jorgen Grahn Guest

    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 .
     
    Jorgen Grahn, Oct 3, 2012
    #2
    1. Advertising

  3. Jonathan Hayward

    Terry Reedy Guest

    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
     
    Terry Reedy, Oct 3, 2012
    #3
  4. (A little quoting manipulation to make it easier to read with
    appropriate context.)


    > > On Wed, Oct 3, 2012 at 11:25 AM, Amirouche Boubekki <> wrote:
    > >

    > 2012/10/3Jonathan Hayward <>

    > > > 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.
     
    Prasad, Ramit, Oct 4, 2012
    #4
  5. Jonathan Hayward

    Terry Reedy Guest

    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
     
    Terry Reedy, Oct 5, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fredrik Lundh

    ANN: the experimental python faq wiki

    Fredrik Lundh, Apr 17, 2006, in forum: Python
    Replies:
    0
    Views:
    284
    Fredrik Lundh
    Apr 17, 2006
  2. Mark Dufour
    Replies:
    1
    Views:
    253
    Paul Boddie
    Dec 5, 2008
  3. Mark Dufour
    Replies:
    27
    Views:
    919
    William Dode
    Jul 27, 2009
  4. Paolo Crosetto

    Turn-based game - experimental economics

    Paolo Crosetto, Sep 5, 2009, in forum: Python
    Replies:
    0
    Views:
    284
    Paolo Crosetto
    Sep 5, 2009
  5. vasudevram
    Replies:
    3
    Views:
    243
    vasudevram
    Sep 2, 2012
Loading...

Share This Page