Web-Books
in the Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Page - 11 -
  • User
  • Version
    • full version
    • text only version
  • Language
    • Deutsch - German
    • English

Page - 11 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Image of the Page - 11 -

Image of the Page - 11 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Text of the Page - 11 -

1.2 APythonProgramwithVariables 11 The documentationfor Spyder8 might be useful to you. Also, more information onwritingand runningPythonprogramsis found inAppendixA.4herein. Whynotapocketcalculator instead? Certainly, finding the answer as with the program above could easily have beendonewithapocketcalculator.Noobjectionstothatandnoprogramming wouldhavebeenneeded.However,whatifyouwouldliketohavetheposition of the ball for every milli-second of the flight? All that punching on the calculatorwouldhave takenyousomething like4h! If you know how to program, however, you could modify the code above slightly, using a minute or two of writing, and easily get all the positions computed inonegowithina second. An even stronger argument, however, is that mathematical models from real life are often complicated and comprehensive. The pocket calculator cannot cope with such problems, even not the programmable ones, because their computational power and their programming tools are far too weak comparedtowhata real computercanoffer. Writeprogramswith a texteditor When Python interprets some code in a file, it is concerned with every character in the file, exactly as it was typed in. This makes it trouble- some to write the code into a file with word processors like, e.g., Mi- crosoft Word, since such a program will insert extra characters, invisible to us, with information on how to format the text (e.g., the font size and type). Such extra information is necessary for the text to be nicely formatted for the human eye. Python, however, will be much annoyed by the extra charactersin thefileinsertedbyawordprocessor.Therefore,it is fundamental that you write your program in a text editor where what you type on the keyboard is exactly the characters that appear in the file and what Python will 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. 8 See, e.g., https://www.spyder-ide.org/.
back to the  book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Title
Programming for Computations – Python
Subtitle
A Gentle Introduction to Numerical Simulations with Python 3.6
Volume
Second Edition
Authors
Svein Linge
Hans Petter Langtangen
Publisher
Springer Open
Date
2020
Language
English
License
CC BY 4.0
ISBN
978-3-319-32428-9
Size
17.8 x 25.4 cm
Pages
356
Keywords
Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
Category
Informatik
Web-Books
Library
Privacy
Imprint
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python