Domain: scipy.org
Stories and comments across the archive that link to scipy.org.
Comments · 104
-
Python...Python is fantastic for this sort of thing. It's very quick to get applications up and running...
It has binding for many GUI libs, including wxWindows. There is also bindings for SDL and OpenGL
:-)If your worried about speed, write an extension module, or try inline C (weave) or use Psyco to genererate optimised code specifically for your data...
-
Pick'n'mix?
I do use Fortran (F95). It runs beautifully both on my Linux desktop and on a remote Alpha cluster on True64. It also runs fine in the Soliaris and SGI workstations. The beauty of F95 is not that it is quite portable, but it is _easy_ You can use loads of time saving constructs which are a pain to deal with in C (I also do C for some other things mind you). If you use Windows, you get some pretty good debuggers (the ones for Linux are quite ugly, and since gcc does not yet support F95, gdb does not particularly care for it).
The thing is that if you tye F9x, you'll find writing the code easy. Learning the language is a no-brainer. You can then interface the numerical stuff with things such as SciPy to display it and so on. -
Re:problems with loops?I think we was talking about "inner loops" -- a classic speed problem for languages like Python. For example, Python is very bad at something like:
i = 1
for j in xrange(1000): i = i + some_func(j)Dumb example, but it more or less shows the issue... when you are dealing with data structures the overhead of the loop isn't that significant (e.g., doing list manipulation). But when you are dealing with numbers there's the potential to be much more efficient, and Python's for loop overhead will be very significant.
Of course Numeric Python can solve many of these problems, as can SciPy's weave and Pyrex, which compiles psuedo-Python to C. You can also program your inner loops directly in C, and make a Python module out of it. Or even write the module in Fortran.
Python clearly isn't a good language to write number crunching algorithms. But it's great for using those algorithms -- and it makes it possible (and relatively easy) to mix in other languages that are good for those algorithms.
-
Re:Things I love about Python..Things I would love about python
:)- A compiler (very hard, but I can dream)
Keep an eye on the weave project here. Currently it allows you to inline C/C++, and work is under way to have automatic acceleration of arbitrary python code via compilation to C/C++. It's *really* cool.