[Tutor] Saving files in Python, IDE's & editors

spir denis.spir at gmail.com
Thu Dec 19 12:15:44 CET 2013


On 12/19/2013 12:56 AM, Steven D'Aprano wrote:
> On Tue, Dec 17, 2013 at 09:28:14PM -0500, Keith Winston wrote:
>> On Tue, Dec 17, 2013 at 7:26 PM, <tutor-request at python.org> wrote:
>>
>>> What else do I need to do to make this version of Python an actually
>>> usable programming environment?
>>>
>>> Chris Acreman
>>>
>>
>> Chris, I'm also a noob, but I would recommend you install/use an IDE, such
>> as IDLE which comes free with all (I think) Python installs. An Integrated
>> Development Environment will help with formatting & debugging, but the way
>> I like to use IDLE is open up a window on the right side of my screen with
>> the file I'm working on, and whenever I want to run it I save (ctrl-S, or
>> menu) and run (F5, or menu), and then watch it go in the other window. Very
>> efficient.
>
>
> I do the same thing, but the IDE I use is called "Unix" or "Linux". With
> just two windows, possibly three, I have access to everything I need to
> program:
>
> - I have an editor open in one window;
>
> - a terminal open in another;
>
> - and optionally a web browser for looking things up on the Internet.
>
>
> In the editor, I can have as many tabs open as needed. I normally use
> kate (the KDE Advanced Text Editor), but from KDE 3 only, not KDE 4
> which is rubbish. I've also started using Geany, which isn't bad.
>
> Sometimes I'll use kwrite, but that has the disadvantage that it doesn't
> have window tabs, but if I just need one or two files open it is
> perfectly adaquate.
>
> In the terminal, multiple tabs are also needed. I'll have at least two
> tabs open: one is set to an interactive Python session, where I can try
> out small code snippets, look up help, and so on; another is set to a
> shell prompt where I can run Python non-interactively, manage files,
> perform version control (e.g. using hg or git), run unit tests, etc.
> Additional tabs are only a click away.
>
> The great thing about Unix as an IDE is that I'm not tied to any one
> single editor. If I decide that editor X is rubbish, I can start using
> editor Y without having to learn a completely new way to run my unit
> tests. If I discover a better way to do source code version control, I
> don't have to throw away my editor. All the individual tools in my tool
> box are separate.
>
> Another good thing about Linux as an IDE is that, with the exception of
> the GUI editor, I can do it all over SSH on a remote computer: ssh to
> the other computer, then use the "screen" command to open as many
> virtual screens as I need. I don't have a GUI, but other than having to
> use a different editor, everything else works exactly the same.
>
> More here:
>
> http://blog.sanctum.geek.nz/series/unix-as-ide/
>
>
> And quoting Zed Shaw:
>
>      An IDE, or “Integrated Development Environment” will turn
>      you stupid. They are the worst tools if you want to be a good
>      programmer because they hide what’s going on from you, and
>      your job is to know what’s going on. They are useful if you’re
>      trying to get something done and the platform is designed
>      around a particular IDE, but for learning to code C (and many
>      other languages) they are pointless.
>
> http://michaelochurch.wordpress.com/2013/01/09/ide-culture-vs-unix-philosophy/

I do agree with most of what you say, except for one point, actually more a 
complement than an contradiction: I find it great whenever editors (I virtually 
never used IDE's properly)  have an integrated terminal (emulator, in fact), 
like geany or gedit. Most, nearly all of my actual programming time (as opposed 
to just thinking in the wild about current projects) is spent in code / run / 
diagnose loops; this means I would constantly be switching from/to 
editor/terminal. Pretty annoying, in my view. (That's also a point I disliked in 
IDLE --maybe it has changed since then: the pseudo-terminal was a separate 
window.) Indeed, the integrated terminal also permit side tasks like file 
management or version control, again in the same environment, and without 
distraction.

As a side-note, I consider the following features of a (programming) editor 
fundamental, even more than syntax highlighting:
* code folding
* integrated terminal
* duplicate (^D in general) (reason why I don't just use gedit, but instead geany)

About syntax highlighting, it is for me rather noise than help if ever I cannot 
precisely, exactly, set it as I like it. Typically there are too many colors, 
and too saturated (in fact, usually pure colors, "toy-store colors" or as a 
friend calls them "Disney colors": veeery baaad, and ugly ;-).

Denis


More information about the Tutor mailing list