updated on May 28, 2019

What is python?

  python is one of popular light weight languages (LWL). 
Unlike compile languages such as C++, Fortran, and Pascal,
we can run python scripts without troublesome and time-consuming compile processes.
Although the calculation speed tends to be slower than the compile languages,
we can develop LWL scripts very efficiently.

  python and many LWL also have other many advantages. 
E.g., they would be better to manage text with assistance of 'regular expression' functions,
and also have good libraries (modules, packages etc) for system programs,
internet programs, science programs etc.

  python has very good, popular science / numerical packages such as numpy, scipy etc
and also graphic packages such as matplotlib with which we can draw graphics in several lines of python scripts.


Install python

python has many distributions such as ActiveState's ActivePython (Free version is called Community Edition) and Anaconda for Windows, macOS, and Linux. Two major version streams, version 2x and 3x, are now used, but version 2x will be obsolete in future.

I recommend you to install anaconda python 3x version (version 3.7 is available as of May 28, 2019).
The following descriptions will be based on the Windows version.

  1. Download Anaconda python 3x version from (Windows, macOS, Linux).
    Choose 'Graphical Installer' if you are not sure about OS, command console etc.
  2. Run the installer. Choose 'Install for: Just Me (recommended)' if you are not sure about OS configurations and programs.

Test python installation

  1. Run command prompt or Windows PowerShell.
  2. Enter the following command (C:\ is the command prompt and shouldn't be input by you. The italic words should be input).  
    C:\> python
    if you see the following response, the installation of python is ok.
     
    C:\>python 
    Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
     
    Warning: 
    This Python interpreter is in a conda environment, but the environment has 
    not been activated. Libraries may fail to load. To activate this environment 
    please see https://conda.io/activation
     
    Type "help", "copyright", "credits" or "license" for more information. 
    >>>
  3. '>>>' is the input prompt of python; you can enter python command to get responses.
    Here, just enter
    >>> exit()
    to exit from the python interactive mode.

Test run python scripts

 (download scripts by 'Save As...' from the context menu of Web browsers)

  1. Download mkcsv.py.
  2. Enter the following command
    C:\> python mkcsv.py
    if you see the following response, 
     
    C:\>python mkcsv.py 
    narg=1 
    Write to [test.csv]

    and find test.csv with the content
    x,y
    0,0
    1,3
    2,5

    , you are ready to use python.
  3. Similarly, test other scripts such as eig.py, list8_1.py, list9_7.py, and list9_8.py to confirm you don't see any error messages.

Install python module

Note: This section is just in case for reminding how to install modules. Anaconda 3.7 includes openpyxl and the following procedure is not needed.

  We can use many useful and efficient functions on python but many of them are distributed as external modules / packages.
For example, OpenPyXL provides functions to handle MS-Excel files but is not included in standard packages of python.
It is installed by pip command as follows:

  1. run
    C:\> pip install openpyxl

@

 

@