Learning Python on jEdit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray

    Learning Python on jEdit

    I want to jump in a learn Python. I have spent about a day looking at
    editors and IDEs and (probably prematurely) selected jEdit to work in.
    I have downloaded Python and jEdit. I have been going over jEdit for
    a while and can't real see how to get it to know that I am using
    Python.

    So there is more there than I expected. Any suggestions on how to
    configure (plugg-ins?) for jEdit and learn Python?

    Ray
  • Jarek Zgoda

    #2
    Re: Learning Python on jEdit

    Ray <rtjoseph@ev1.n et> pisze:
    [color=blue]
    > I want to jump in a learn Python. I have spent about a day looking at
    > editors and IDEs and (probably prematurely) selected jEdit to work in.
    > I have downloaded Python and jEdit. I have been going over jEdit for
    > a while and can't real see how to get it to know that I am using
    > Python.[/color]

    jEdit detects file type by extension, so Python syntax highlighting
    will not work until you save the file with py or pyw extension.

    --
    Jarek Zgoda

    Comment

    • Sean Ross

      #3
      Re: Learning Python on jEdit


      "Jarek Zgoda" <jzgoda@gazeta. usun.pl> wrote in message
      news:c1dlp0$r11 $5@nemesis.news .tpi.pl...
      [snip][color=blue]
      > jEdit detects file type by extension, so Python syntax highlighting
      > will not work until you save the file with py or pyw extension.[/color]

      Actually you can set the edit mode manually as well:



      """
      The edit mode can be specified manually as well. The current buffer's edit
      mode can be set on a one-time basis in the Utilities>Buffe r Options dialog
      box;
      """

      Plus you can set the default edit mode to python, so that when you create a
      new file it's already in python-mode.


      Ray:

      You may want to use the plug-in manager[1] to get the console plug-in so you
      can run your programs from within the IDE. You may also appreciate the
      Jython plug-in. Peronally, I like having the BufferTabs plug-in as well. I
      actually tend to use Komodo for Python, but I have jEdit installed for
      programming in several other languages and I'm pretty happy with it. Enjoy.

      Sean


      [1] http://www.jedit.org/users-guide/using-plugins.html



      Comment

      • David Rushby

        #4
        Re: Learning Python on jEdit

        rtjoseph@ev1.ne t (Ray) wrote in message news:<d422a60.0 402231132.19acd c74@posting.goo gle.com>...[color=blue]
        > I want to jump in a learn Python. I have spent about a day looking at
        > editors and IDEs and (probably prematurely) selected jEdit to work in.
        > I have downloaded Python and jEdit.[/color]

        Even though I love jEdit, its Python-awareness isn't as good as that
        of a Python-specific IDE. Since you're in the process of learning
        Python, I recommend that you use as your interactive console an editor
        that has Python object member pop-ups and parameter tips (e.g.,
        Pythonwin, or OrbTech's PyShell (which comes with wxPython)). I use
        PyShell as my interactive console and jEdit as my main editor.

        I edit Python and C/C++ source code for many hours a day with jEdit,
        and have been doing so since 1999, so obviously I regard jEdit as a
        suitable editor for Python source. IMO, jEdit's most compelling
        (though not unique) features are code folding, HyperSearch, multiple
        views/split views, and markers. My workstation has multiple monitors,
        and I can spread several semi-autonomous 'views' from a single
        instance of jEdit across them to simultaneously view several pieces of
        code at once. Markers (with appropriate Back/Set/Forward keyboard
        shortcuts) allow me to hop around huge source files without touching
        the mouse.
        [color=blue]
        > I have been going over jEdit for a while and can't real see how to get it
        > to know that I am using Python.[/color]

        In the Utilities->Global Options->Editing dialog (of jEdit 4.1), you
        can change Python-specific settings by selecting 'Python' from the
        'Change settings for mode' drop-down. I have mine set to 'Tab width':
        4, 'Indent width': 4, 'Soft (emulated with spaces) tabs': yes. Save
        yourself some hassle and don't mix tabs and spaces in your Python
        source code. jEdit can paper over the difference between soft and
        hard tabs, so there are no extra keypresses required.

        This dialog also allows you to specify which filename extensions are
        to be considered Python source files, or which textual pattern on the
        first line of a source file indicates same (e.g., '#/usr/bin/env
        python').

        If you use jEdit for virtually nothing other than editing Python
        source, you can set Python mode as the default via the 'Default Edit
        Mode' option in that same Utilities->Global Options->Editing dialog.
        [color=blue]
        > So there is more there than I expected. Any suggestions on how to
        > configure (plugg-ins?) for jEdit and learn Python?[/color]

        jEdit's indentation-based code folding works very well with Python out
        of the box.

        Since Python has syntactically significant whitespace, jEdit's
        Whitespace plugin is a real help. In particular, turn on
        Utilities->Global Options->Plugins->Whitespace->Fold guides->Show fold
        guides by default. I have Whitespace set to display a faint grey
        vertical line along Python indentation planes.

        jEdit also has a Jython plugin, which, among other capabilities,
        allows you to write jEdit macros in Python. There's also a plugin
        called Py Utils, but I haven't used it.

        Comment

        • Ray

          #5
          Re: Learning Python on jEdit

          David,

          Thanks for all the details, I have a few questions.

          You mentioned that jEdit is not Python specific and that others may be
          more appropriate for learning. Later, you addressed how to get jEdit
          to recognize Python. Are you saying that even with the Python
          plug-ins and options, the Python only IDEs would be better for
          learning?

          I looked at PyShell and Pythonwin. The documentation says that
          Pythonwin was designed for MFC. I found no mention to MFC. What's up
          with MFC and how relevent is it?

          Ray

          woodsplitter@ro cketmail.com (David Rushby) wrote in message news:<7876a8ea. 0402240005.6e33 13eb@posting.go ogle.com>...[color=blue]
          > rtjoseph@ev1.ne t (Ray) wrote in message news:<d422a60.0 402231132.19acd c74@posting.goo gle.com>...[color=green]
          > > I want to jump in a learn Python. I have spent about a day looking at
          > > editors and IDEs and (probably prematurely) selected jEdit to work in.
          > > I have downloaded Python and jEdit.[/color]
          >
          > Even though I love jEdit, its Python-awareness isn't as good as that
          > of a Python-specific IDE. Since you're in the process of learning
          > Python, I recommend that you use as your interactive console an editor
          > that has Python object member pop-ups and parameter tips (e.g.,
          > Pythonwin, or OrbTech's PyShell (which comes with wxPython)). I use
          > PyShell as my interactive console and jEdit as my main editor.
          >
          > I edit Python and C/C++ source code for many hours a day with jEdit,
          > and have been doing so since 1999, so obviously I regard jEdit as a
          > suitable editor for Python source. IMO, jEdit's most compelling
          > (though not unique) features are code folding, HyperSearch, multiple
          > views/split views, and markers. My workstation has multiple monitors,
          > and I can spread several semi-autonomous 'views' from a single
          > instance of jEdit across them to simultaneously view several pieces of
          > code at once. Markers (with appropriate Back/Set/Forward keyboard
          > shortcuts) allow me to hop around huge source files without touching
          > the mouse.
          >[color=green]
          > > I have been going over jEdit for a while and can't real see how to get it
          > > to know that I am using Python.[/color]
          >
          > In the Utilities->Global Options->Editing dialog (of jEdit 4.1), you
          > can change Python-specific settings by selecting 'Python' from the
          > 'Change settings for mode' drop-down. I have mine set to 'Tab width':
          > 4, 'Indent width': 4, 'Soft (emulated with spaces) tabs': yes. Save
          > yourself some hassle and don't mix tabs and spaces in your Python
          > source code. jEdit can paper over the difference between soft and
          > hard tabs, so there are no extra keypresses required.
          >
          > This dialog also allows you to specify which filename extensions are
          > to be considered Python source files, or which textual pattern on the
          > first line of a source file indicates same (e.g., '#/usr/bin/env
          > python').
          >
          > If you use jEdit for virtually nothing other than editing Python
          > source, you can set Python mode as the default via the 'Default Edit
          > Mode' option in that same Utilities->Global Options->Editing dialog.
          >[color=green]
          > > So there is more there than I expected. Any suggestions on how to
          > > configure (plugg-ins?) for jEdit and learn Python?[/color]
          >
          > jEdit's indentation-based code folding works very well with Python out
          > of the box.
          >
          > Since Python has syntactically significant whitespace, jEdit's
          > Whitespace plugin is a real help. In particular, turn on
          > Utilities->Global Options->Plugins->Whitespace->Fold guides->Show fold
          > guides by default. I have Whitespace set to display a faint grey
          > vertical line along Python indentation planes.
          >
          > jEdit also has a Jython plugin, which, among other capabilities,
          > allows you to write jEdit macros in Python. There's also a plugin
          > called Py Utils, but I haven't used it.[/color]

          Comment

          Working...