Learning Python on jEdit

R

Ray

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
 
J

Jarek Zgoda

Ray said:
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.

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

Sean Ross

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

Actually you can set the edit mode manually as well:

http://www.jedit.org/users-guide/modes.html#mode-selection

"""
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>Buffer 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
 
D

David Rushby

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.

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

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.
So there is more there than I expected. Any suggestions on how to
configure (plugg-ins?) for jEdit and learn Python?

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

Ray

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
 

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

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,517
Latest member
Andres38A1

Latest Threads

Top