Web-Books
im Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python
Seite - 6 -
  • Benutzer
  • Version
    • Vollversion
    • Textversion
  • Sprache
    • Deutsch
    • English - Englisch

Seite - 6 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Bild der Seite - 6 -

Bild der Seite - 6 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Text der Seite - 6 -

6 1 TheFirstFewSteps foreverymilli-secondof theflight?All thatpunchingon thecalculatorwouldhave takenyou something like four hours! If youknowhow toprogram, however, you couldmodify the codeabove slightly, using aminute or twoofwriting, and easily get all the positions computed in one gowithin a second. Amuch stronger argu- ment,however, is thatmathematicalmodelsfromreal lifeareoftencomplicatedand comprehensive. The pocket calculator cannot copewith such problems, even not theprogrammableones,because their computationalpowerandtheirprogramming toolsare far tooweakcompared towhat a real computercanoffer. 1.2.4 WhyYouMustUseaTextEditortoWritePrograms WhenPython interprets some code in a file, it is concernedwith every character in thefile, exactly as itwas typed in. Thismakes it troublesome towrite the code into a filewithword processors like, e.g.,MicrosoftWord, since such a program will insert extra characters, invisible to us,with informationonhow to format the text (e.g., the font size and type). Such extra information is necessary for the text tobenicely formatted for thehumaneye. Python,however,will bemuchannoyed by the extra characters in the file inserted by a word processor. Therefore, it is fundamental that youwrite your program in a text editorwherewhat you type on the keyboard is exactly the characters that appear in the file and that Pythonwill later read. There are many text editors around. Some are stand-alone programs like Emacs, Vim, Gedit, Notepad++, and TextWrangler. Others are integrated in graphical development environments for Python, such as Spyder. This bookwill primarily refer toSpyderand its texteditor. 1.2.5 InstallationofPython Youwill need access to Python and several add-onpackages for doingmathemat- ical computations and display graphics. An obvious choice is to install a Python environment for scientific computingonyourmachine. Alternatively, you canuse cloud services for runningPython, or you can remote login on a computer system ataschooloruniversity.Availableandrecommended techniques forgettingaccess toPythonand theneededpackagesaredocumented inAppendixA. Thequickestway toget startedwith aPython installation for this bookonyour Windows,Mac,orLinuxcomputer, is to installAnaconda3. 1.2.6 WriteandRunYourFirstProgram Reading only does not teach you computer programming: you have to program yourself andpractice heavilybeforeyoumastermathematical problemsolvingvia programming. Therefore, it is crucial at this stage that youwrite and runaPython program. We justwent through the programball.py above, so let us nextwrite and run that code. 3http://continuum.io/downloads
zurück zum  Buch Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python
Titel
Programming for Computations – Python
Untertitel
A Gentle Introduction to Numerical Simulations with Python
Autoren
Svein Linge
Hans Petter Langtangen
Verlag
Springer Open
Datum
2016
Sprache
englisch
Lizenz
CC BY-NC 4.0
ISBN
978-3-319-32428-9
Abmessungen
17.8 x 25.4 cm
Seiten
248
Schlagwörter
Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
Kategorie
Informatik
Web-Books
Bibliothek
Datenschutz
Impressum
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python