Skip to content

Latest commit

 

History

History
88 lines (69 loc) · 5.09 KB

File metadata and controls

88 lines (69 loc) · 5.09 KB

Where to begin?

As a beginner, if I could buy only two books on Python, I would buy these two (and, if I could buy only one, it would certainly be the second one because it has a very well written introduction on Python language):

However, if you are interested in a scientific-oriented complete reference with a lot of examples, I would strongly recommend this one:

Python Scripting for Computational Science”, Hans Petter Langtangen, Ed.: Springer, ISBN-13: 978-3-540-73915-9.

See the bibliography page for more references.

Of course, it is possible to learn Python without buying anything: Python(x,y) includes almost all freely available documentations, online books, examples and tutorials that I could gather on the internet (please do not hesitate to contact me if you wish to include your own findings).

IDLE

For your first lines in Python, you won’t need any sophisticated IDE. IDLE (Figure 1), that is the Python IDE written by Python creator himself (Guido van Rossum), is powerful enough to edit and run short scripts. It also provides a Python interpreter to run interactively your code (Figure 2).

Note that when one is used to MATLAB's IDE for example, IDLE may seems too much limited/simple in comparison. But that is its purpose: to provide a simple but efficient IDE to begin with Python programming language. If you are looking for something more powerful but easy-to-use as well, please go directly to next paragraph for a detailed description of the IDE that will probably fit all your needs (except write your programs), Spyder.

Figure 1 : IDLE editor window

Figure 2 : IDLE shell window

To begin with, you may run and then edit matplotlib examples in Python(x,y)
documentation (Libraries\matplotlib\examples).


Spyder

Since 2009, a new scientific development environment for Python is available. Inspired from MATLAB's IDE, Spyder is intended to facilitate a migration from MATLAB to Python as it provides essential features for scientific users like the variable explorer (analog to MATLAB's "Workspace") or data import wizard.

So, Spyder is a powerful scientific IDE providing the following
features:

  • interactive console with:
    • code completion, brace matching, help (or function arguments) tips, ...
    • global variables browser with GUI-based editors for arrays, lists, dictionaries, and so on
    • import features: from text files, MATLAB files, ...
  • external console: executed in a separate process, this console may be used to run application safely (with almost all the interactive console features cited above)
  • editor:
    • code completion, syntax coloring, code folding, automatic indentation
    • real-time code analysis: pyflakes (integrated) and pylint (plugin)
    • vertical/horizontal separation
    • class/function browser
  • find in files feature
  • file explorer
  • object inspector
  • online help browser on installed Python modules (since v1.1.0)
  • project manager/explorer (since v1.1.0)

For more details and screenshots, please visit the Spyder website.


IPython

For rapid prototyping, one can test simple commands or run scripts
interactively using the powerful features of IPython (Figure 3), an enhanced
Python shell in which – for example – matplotlib features are available
through the pylab interface which offers a syntax very close to MATLAB’s.

Figure 3 : Python(x,y) interactive console (IPython with Console 2.0)

IPython with matplotlib, numpy and Scipy support can be executed
from its start menu entry (“Python-Matplotlib console”) or from any file
folder by right-clicking on it (“Open Python console here…”), see Figure 4.

Figure 4 : Python console integration in Windows Explorer

Learn more on this topics in Python(x,y) documentation :
“Using matplotlib interactively” (Library\matplotlib).