Python Scripting for Computational Science
Springer Science & Business Media, 2009 M01 9 - 756 pages
Numerous readers of the second edition have noti?ed me about misprints and possible improvements of the text and the associated computer codes. The resulting modi?cations have been incorporated in this new edition and its accompanying software. The major change between the second and third editions, however, is caused by the new implementation of Numerical Python, now called numpy. The new numpy package encourages a slightly di?erent syntax compared to the old Numeric implementation, which was used in the previous editions. Since Numerical Python functionality appears in a lot of places in the book, there are hence a huge number of updates to the new suggested numpy syntax, especially in Chapters 4, 9, and 10. The second edition was based on Python version 2.3, while the third edition contains updates for version 2.5. Recent Python features, such as generator expressions (Chapter 8.9.4), Ctypes for interfacing shared libraries in C (Chapter 5.2.2), the with statement (Chapter 3.1.4), and the subprocess module for running external processes (Chapter 3.1.3) have been exempli?ed to make the reader aware of new tools. Chapter 4.4.4 is new and gives a taste of symbolic mathematics in Python.
What people are saying - Write a review
Most of the book is absolutely great. The downloadable base of utilities is a great set of examples that also proves useful in everyday life. The examples are well thought through and not, as in many other books, just continuations of a fairly useless codebase that tries to make every aspect of Python clear through one use(less) case. The order of the chapters seems somewhat odd at first. In the end it looks like a well designed build-up of complexity, with only a little price to pay (some tiny bits of repetition and to experienced users sometimes unclear where to find what). Although knowledge of Python is not necessary, there is not a lot of space in the book wasted on the basics (previous experience in programming is, in fact, helpful). The book is oriented towards scientists and engineers, with a lot of code ready in C/C++/Fortran who need to glue that code together and possibly do some additional numerical or analysis work on the data. It is also perfectly suited for people who want to use only Python for their (numerical and analysis) work. Topics covered: 1) Basic Python (clean, clear, quick, some more than usual emphasis on handy I/O functionality) 2) Advanced Python (clear, many more useful extras like regular expressions, parsing command line options, iterators, etc. than in many other books, good examples, missing topic: decorators) 3) NumPy and numeric analysis (extensive, very good, could have had more on SciPy, some emphasis on older/obsolete packages like Numeric, ScientificPython, not enough on e.g. Matplotlib) 3) Interfacing with C/C++/Fortran through arrays (very useful and well explained) 4) GUI programming (clear, maybe a bit too much of advanced GUI programming, which could have been figured out by interested users by themselves, seems like too much emphasis for this topic) 5) cgi programming/web interfaces (nice little extra gadget in my opinion, most scientists won't necessarily use this). One feature that highly surprised me was the preferred use of from name import *, which I think is a bad habit. At some point it is even presented as useful when the same function name gets redefined in the global namespace, which I think is not something you want people to do. Other than that: great book and definitely worth its price!
Muito, muito bom e completo.
Getting Started with Python Scripting 27
1 Become familiar with the electronic documentation
5 Use standard inputoutput instead of ﬁles
13 Compute time step values in the simviz1 py script
16 Combine twocolumn data ﬁles to a multicolumn ﬁle
1 Write format speciﬁcations in printfstyle
Introduction to GUI Programming
Web Interfaces and CGI Programming
Fortran Programming with NumPy Arrays
More Advanced GUI Programming
Tools and Examples 605
A Setting up the Required Software Environment
B Elements of Software Engineering