Seite - 312 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Bild der Seite - 312 -
Text der Seite - 312 -
312 A InstallationandUseofPython
• Matplotlib4 [7,8] forplotting
• IPython5 [21,22] for interactivecomputing
• SymPy6 [2] for symbolicmathematics
• Spyder7 if you want to write and runyourprogramsas we (primarily)do in this
book.
In addition, allthough not used herein, the following packages might be of interest
toyou(probablyat some later stage, ifyouareanewbie):
• SciTools8 [13] foradd-ons toNumPy
• ScientificPython9 [26] foradd-ons to NumPy
• pytest10 ornose11 for testingprograms
• pip12 for installingPythonpackages
• Cython13 forcompilingPython to C
• SciPy14 [9] foradvancedscientificcomputing
Convertinga Python2ProgramtoPython3
Python comes in two versions, version 2 and 3, and these are not fully
compatible. However, for the programs in this book, the differencesare very
small, themajoronebeingprint,which inPython2 is a statement like
print ’a:’, a, ’b:’, b
while inPython3 it is a functioncall
print( ’a:’, a, ’b:’, b)
The code in this book is written in Python 3.6. However, you may come
across code elsewhere that is written in Python 2, and you might prefer to
have that code in Python3. The goodnews, is that portingcode from Python
2 to Python 3 is usually quite straight forward. One alternative, is to use the
program2to3. Running2to3 prog.pywill transform a Python 2 program
prog.py to its Python 3 counterpart. One can also use tools likefutureor
six to easily write programs that run under both Python 2 and 3. Also, the
futurizeprogramcanautomaticallydo this foryoubasedonv2.7code.
4 http://matplotlib.org.
5 http://ipython.org.
6 http://sympy.org.
7 https://github.com/spyder-ide/spyder.
8 https://github.com/hplgit/scitools.
9 http://starship.python.net/crew/hinsen.
10 http://pytest.org/latest/.
11 https://nose.readthedocs.org.
12 http://www.pip-installer.org.
13 http://cython.org.
14 http://scipy.org.
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
- Titel
- Programming for Computations – Python
- Untertitel
- A Gentle Introduction to Numerical Simulations with Python 3.6
- Band
- Second Edition
- Autoren
- Svein Linge
- Hans Petter Langtangen
- Verlag
- Springer Open
- Datum
- 2020
- Sprache
- englisch
- Lizenz
- CC BY 4.0
- ISBN
- 978-3-319-32428-9
- Abmessungen
- 17.8 x 25.4 cm
- Seiten
- 356
- Schlagwörter
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Kategorie
- Informatik