Archive

Posts Tagged ‘ide’

PyScripter: a very nice small IDE for Windows

April 8, 2014 Leave a comment

I found a very nice small Python IDE for Windows called PyScripter.

PyScripter is a free and open-source Python Integrated Development Environment (IDE) created with the ambition to become competitive in functionality with commercial Windows-based IDEs available for other languages. Being built in a compiled language is rather snappier than some of the other Python IDEs and provides an extensive blend of features that make it a productive Python development environment.” (source)

The install file is less than 5 MB and PyScripter provides all the features you want from a modern IDE: syntax highlight, run code and see the output, code completion, built-in Python shell, debugger, etc.

Here is a youtube video for beginners that shows first how to install Python on Windows, then presents PyScripter.

Categories: python, windows Tags: , ,

Eclipse-PyDev on steroids: Aptana Studio

December 7, 2012 2 comments

aptanaYesterday I tried Aptana Studio 3 and I’m impressed. My preferred IDE was Eclipe with the PyDev plugin. The good news is Aptana Studio is built on Eclipe, but it contains lots of useful plugins preinstalled (PyDev is among them). So it feels like a tuned up Eclipse :)

I think I will use Aptana from now on for larger projects. And it’s free, of course.

A Fast and Powerful Text Editor: Sublime Text 2

August 9, 2012 1 comment

I tried Sublime Text 2 today and it looks great. Note that ST2 is not open source and you should purchase a license if you want to use it after evaluation. However, there is currently no enforced time limit for the evaluation.

First of all, it is cross-platform (Linux, Windows, OS X). There is no need to install it: just download an archive file and unpack it. Under Linux I put it to /opt (/opt/Sublime\ Text\ 2). In order to call it with the command “st“, I put the following script in my $HOME/bin directory (where $HOME/bin is in my PATH):

#!/bin/sh
# call ST2 with parameters in the background
/opt/Sublime\ Text\ 2/sublime_text "$@" &

ST2 has tons of plugins available. To install them easily, first install “Sublime Package Control” (follow this link, everything is explained there).

I find the following plugins particularly useful:

  • SublimeRope (code-completion/refactoring)
  • SublimeLinter (check your syntax on the fly)
  • SublimeREPL (python/bash/cmd/etc integrated console)

How to install a plugin: in ST2, press Ctrl+Shift+P. Select “Package Control: Install Package”. Then choose a plugin to be installed.

Color Scheme: well, I tried ‘em all but I didn’t really like any of them. So I stayed with the default (Monokai). If you know a cool color scheme, let me know.

In Python, it’s a good idea not to mix tabs and spaces. Here is how to replace tabs with spaces automatically: under Preferences -> Settings-User, add the following line:

"translate_tabs_to_spaces": true

Rename multiple instances of a word (beware, in the case of variables scope is not taken into account): Alt+F3.

User config files are stored in $HOME/.config/sublime-text-2/Packages/User.

If you want to enable / disable the automatic linting, add the following lines to SublimeLinter’s user keymap (thanks jswartwood for the tip):

// Enable background linting
{ "keys": ["ctrl+shift+l"], "command": "sublimelinter_lint", "args": {"action": "on"} },
// Disable linting
{ "keys": ["ctrl+shift+d"], "command": "sublimelinter_disable", "args": {"action": "off"} },

Links

Update (20120813)
I found a nice color scheme, available here (down at the Bonus Options, direct link here). “Unzip and place the extracted tmtheme files in the Sublime Text 2 Packages/User folder, then enable the colour scheme via Preferences -> Color Scheme -> User“.

Categories: python Tags: , ,

UliPad: a lightweight Python editor based on wxPython

November 12, 2011 Leave a comment

Ulipad is a wxPython powered, programmer oriented and flexible editor. It has many features such as class browser, code auto-complete, html viewer, directory browser, wizard and many others.

For writing Python code, I usually use vim (for small scripts) and Eclipse + PyDev (for larger projects with more than one file). Ulipad with the black color scheme looks very similar to the elflord theme of vim that I use, so I felt comfortable right away :) When you save a file in Ulipad, it checks the source against the PEP8 recommendations and provides a list of warnings. Clicking on a warning brings the cursor to the appropriate line, making corrections very easy.

There is only one thing that I missed (or didn’t find): intelligent renaming, i.e. renaming just in a scope. I think this is the most important refactoring step, so it’s a must-have for me. This is one of the main reasons why I use PyDev.

I haven’t tested Ulipad much yet but I plan to use it for smaller scripts. Even if you use another editor, Ulipad can serve you for polishing the source to follow PEP8.

Thanks Yves for recommending UliPad.

Categories: python Tags: , , , ,

Turning Vim into a modern Python IDE

September 13, 2011 Leave a comment

For text editing I use vim. When writing Python code and the script is short, vim is OK. However, if it’s a larger project, then I prefer an IDE (PyDev for instance).

Today at reddit someone directed me to the post Turning Vim into a modern Python IDE by Jonh Anderson. I will give it a try :)

Categories: python Tags: , ,

Eclipse with PyDev

May 2, 2011 1 comment

Update (20121208)
If you want a tuned up Eclipse-Pydev, try Aptana Studio.


For small scripts I use vim or Eric but for a larger project I prefer Eclipse with the PyDev Python plugin.

Installation:

  • Download Eclipse. You can get the IDE for Java Developers.
  • Add the plugin PyDev using the repository http://pydev.org/updates.
  • Since the new Ubuntu 11.04 uses Python 2.7 by default, you can tell Eclipse too to use it instead of version 2.6. Go to Window -> Preferences, then Pydev -> Interpreter – Python. Remove Python 2.6 and add Python 2.7.

Now if you want to create a new Python project, choose New -> Pydev Project.

Advantages:

Pydev has lots of cool features. My favorites:

  • code completion (CTRL + Space)
  • Rename (Shift + Alt + R), which works through projects too! Say, you have two projects, A and B. A is a library that is used by B. If you reference A from B correctly then if you rename something in A, PyDev will rename the necessary references in B too. I find it very useful when doing refactoring and trying to find better names for functions/variables.
  • debugger (F11)
  • jump around (hold CTRL and left click with your mouse on a function name to jump to the function’s definition)

Update (20110911)
With PyDev, I get “unresolved import” errors quite often, even if the import is correct and the script runs fine. Here I found some tips how to get rid of them:

  • Click Ctrl + 1 and select “Unresolved import error”. This will hide the error.
  • Under Preferences -> PyDev -> Editor -> Code Analysis, go to the Imports tab. Change Import redefinition from “Error” to “Warning”. I don’t recommend “Ignore” because it will hide the real errors too.

For more tips, refer to this post.

What IDE to use for Python?

April 4, 2011 2 comments

For a comprehensive list of Python IDEs and comments, refer to this thread: http://stackoverflow.com/questions/81584/what-ide-to-use-for-python.

Results so far:

  1. PyDev with Eclipse (CP, F, AC, PD, EM, SI, MLS, UML, SC, UT, LN, CF, BM, CT)
  2. Komodo (CP, C/F, MLS, PD, AC, SC, SI, BM, LN, CF, CT, EM, UT, DB)
  3. Vim (CP, F, AC, MLS, SI, BM, LN, CF, UT, PD, EM, SC, CT)
  4. Emacs (CP, F, AC, MLS, PD, EM, SC, SI, BM, LN, CF, CT, UT, UML)
  5. TextMate (Mac, CT, CF, MLS, SI, BM, LN)
  6. Gedit (Linux/Windows, F, AC, MLS, SI, BM, LN, CT [sort of])
  7. Idle (CP, F, AC)
  8. PIDA (Linux/Windows, CP, F, AC, MLS, SI, BM, LN, CF)(VIM Based)
  9. NotePad++ (Windows, F, MLS, LN)
  10. BlueFish (Linux)
  11. JEdit (CP, F, BM, LN, CF, MLS)
  12. E-Texteditor (TextMate Clone for Windows)
  13. WingIde (CP, C, AC, MLS (support for C), PD, EM, SC, SI, BM, LN, CF, CT, UT)
  14. Eric Ide (CP, F, AC, PD, EM, SI, LN, CF, UT)
  15. Pyscripter (Windows, F, AC, PD, EM, SI, LN, CT, UT)
  16. ConTEXT (Windows, C)
  17. SPE (F, AC, UML)
  18. SciTE (CP, F, MLS, EM, BM, LN, CF, CT, SH)
  19. Zeus (W, C, BM, LN, CF, SI, SC, CT)
  20. NetBeans (CP, F, PD, UML, AC, MLS, SC, SI, BM, LN, CF, CT, UT, RAD)
  21. DABO (CP)
  22. BlackAdder (C, CP, CF, SI)
  23. PythonWin (W, F, AC, PD, SI, BM, CF)
  24. Geany (CP, F, very limited AC, MLS, SI, BM, LN, CF)
  25. UliPad (CP, F, AC, PD, MLS, SI, LI, CT, UT, BM)
  26. Boa Constructor (CP, F, AC, PD, EM, SI, BM, LN, UML, CF, CT)
  27. ScriptDev (W, C, AC, MLS, PD, EM, SI, BM, LN, CF, CT)
  28. Spyder (CP, F, AC, PD, EM, SI, BM, LN)
  29. Editra (CP, F, AC, MLS, SC, SI, BM, LN, CF)
  30. Pfaide (Windows, C, AC, MLS, SI, BM, LN, CF, CT)
  31. KDevelop (CP, F, MLS, SC, SI, BM, LN, CF)
  32. Dr.Python (F,EM)
  33. DreamPie (F)
  34. PyCharm (CP, C, AC, PD, EM, MLS (Javascript), SC, SI, BM, LN, CF, PD, UT)
  35. Sublime Text (CP, C, AC, MLS, SI, BM, LN, CT, extensible with Python)

Currently, I’m using Eric4. Works well for me.

Categories: python Tags:

Install the Eric Python IDE

March 15, 2011 Leave a comment

Eric is a full featured Python and Ruby editor and IDE, written in Python. It is based on the cross platform Qt GUI toolkit, integrating the highly flexible Scintilla editor control. It is designed to be usable as everdays’ quick and dirty editor as well as being usable as a professional project management tool integrating many advanced features Python offers the professional coder. Eric4 includes a plugin system, which allows easy extension of the IDE functionality with plugins downloadable from the net. Current stable versions are eric4 based on Qt4 and Python 2 and eric5 based on Python 3 and Qt4.” (source)

As I’m still using Python 2, I will show you how to install eric4. Unfortunately, there is a very old version in the official Ubuntu repositories. Let’s see how to install an up-to-date version.

First, install it via apt-get. The advantage here is that all the dependencies will be installed.

sudo apt-get install eric

Apt-get will suggest some additional packages, it’s a good idea to install them too. Then, download the latest stable version of eric4. Remove the old version that we installed via apt-get:

sudo apt-get remove eric

Remember, the dependencies remain, so we can install the latest version without any problem. Uncompress the downloaded archive and execute install.py as root:

sudo ./install.py

Now you can start the editor with “eric4“.

I find it a very nice IDE for Python. It has tons of cool features still it’s lightweight. If I want to edit a simple script, I won’t start Eclipse (with the Python plug-in), it’s too slow… But if I want more than pure vim :), eric4 is a good choice.

Troubleshooting

In my case, the installer didn’t work perfectly: it didn’t set the rights correctly, thus I couldn’t execute eric4 as a normal user. I asked some people, they said they didn’t have this problem… Anyway, here is what I had to do:

  • Copy setjog_here.sh (see below) to /usr/lib/python2.6/dist-packages/eric4 and execute it as root. It will correct the rights.
  • Repeat the step above with the directory /usr/lib/python2.6/dist-packages/eric4plugins too.

setjog_here.sh:

#!/bin/bash

find . -type d -print0 | xargs -0 chmod 755
find . -type f -print0 | xargs -0 chmod 644
chmod 755 .
chmod u+x $0

There is one more step to do: copy eric4config.py (from the uncompressed install directory) to /usr/lib/python2.6/dist-packages/eric4. Don’t forget to set its rights (chmod 644 eric4config.py).

Now, you should be able to start the IDE with “eric4“.

Update (20110401)

I have this problem with the wrong permissions with other packages too that I install with “pip”, so this is not an eric-specific issue. But with the bash script above I can correct it easily.

Categories: python Tags: , , , ,
Follow

Get every new post delivered to your Inbox.

Join 61 other followers