September 23, 2018

World Travel
2017.8.14-21 Field survey in upper Gulf of Thailand and lecture at Burapha University

Dr. Sasaki was invited by Burapha University for delevering a lecture and performing a field survey in upper Gulf of Thailand.

Read more
Python
Import module or package in Python

Suppose that a main script of [cci]main.py[/cci] (or a corresponding [cci]Jupyter Notebook[/cci]) exists in the directory of [cci]myproject[/cci], and its subdirectory [cci]sub[/cci] contains modules of [cci]mod_a.py[/cci] (a function of [cci]func_a ()[/cci] included) and [cci]mod_b.py[/cci] (a function of [cci]func_b()[/cci] included) where [cci]main.py[/cci] imports the module [cci]mod_a[/cci] and the module [cci]mod_a[/cci] imports the module [cci]mod_b[/cci]. First, creating an empty file [cci]__init__.py[/cci] in the directory [cci]sub[/cci] so that [cci]sub[/cci] is recognized as a package as shown below: [cc] myproject/ main.py sub/ __init__.py mod_a.py (func_a()) mod_b.py (func_b()) [/cc] The sub-directory, [cci]sub[/cci], containing two modules, becomes a package when [cci]__init__.py[/cci] is included. Import [cci]mod_a.py[/cci] in [cci]main.py[/cci] The following is how to import the module [cci]mod_a.py[/cci] […]

Read more