Python from the view point of a Modula-2 user

Overview

Python is by now a popular computer language. It is often said that Python is a good choice for novices to learn computer language. I myself started to learn Python when I found the book, J.Shovic and A.Simpson, Python All-in-One for Dummies (Wiley, 2019) in September 2022.

However, the ease of Python may tend to sacrifices other aspects: PyPlotLib sometimes yield graphs that are different from my expectation, as regards height, aspect ratio, etc. Also I have once wrote two similar loops that involved a variable, say x, but Python understood x as different types in these loops. These may be caused by insufficient experience of mine, but must be unthinkable with Modula-2.

I have been working with Modula-2 for more than 30 years. My Modula-2 system on Windows 11 is described here. It also explains the installation and customization of the system.

Updating Berendsen's sample Python programs

I translated with Dr. R. Baba the textbook, H.J.C.Berendsen, A Student's Guide to Data and Error Analysis (Cambridge, 2011) in 2013. Recently several python programs therein were tested but none of them could be run without revisions. The updated programs are listed in the left.

Python programs vs Modula-2 programs

I realized that it must be easier for me to write Python programs with reference to Modula-2 programs, many of which had been completed years ago.

  1. Reading and scaling file (1),   Reading file (1a)

  2. Making a probability paper

  3. Probability that two persons sit next each other in the pilates studio

  4. Where is the Sun traversing?

  5. How does the sum move in the sky?

  6. Grundy numbers

  7. Computer Game of 'Corner the Queen'

  8. Let's traverse over desktop icons

 

 

(c) 2022-2023, S. Hayashi