A training to acquire strong basis in Python to use it efficiently
Pierre Augier (LEGI), Cyrille Bonamy (LEGI), Eric Maldonado (Irstea), Franck Thollard (ISTERRE), Christophe Picard (LJK)
Let's write your own package with a command line tool!
The goal of this session is produce a small package providing a command line application to show images of raccoons.
You will have to organise your code in different files in a package.
A template projet folder is provided (TP/TP2_package/mypackuga
). Let's first analyze its content.
There are 1 folder (mypackuga) and 4 files:
README.rst
This file is writen in the markup language "restructuredtext". It should contain a description of the package and instructions how to install it.
LICENSE.txt
This file is important! Don't forget it in your project. It contains the license.
setup.cfg
This file contains information on the package (its name, the version, a short description, ...)
setup.py
This is the file to be executed to install the project.
The directory mypackuga
is the package. It contains the code.
Install the package with:
cd TP/TP2_package/mypackuga
cat README.rst
python setup.py develop
The command line utility mypackuga-raccoon
should be available. Try it!
# to get the help
mypackuga-raccoon -h
# to call the program
mypackuga-raccoon
# to see where is the corresponding file
which mypackuga-raccoon