3  Building Packages

3.1 Task : Create a Python Package

3.1.1 Build Package “istec-p4

  • Create a project/package named istec-p4 which will use any of your existing virtual environments.
  • Use the correct naming for your project, packages and modules.
  • Create a package with the following structure istec/p4/exercises.
  • Within this package, create a module named greetings with the following within:
    • A function named hello to execute print(“Hello World!!”)
    • A function named good_morning to execute print(“Good Morning!!”)
    • A function named good_afternoon to execute print(“Good Afternoon!!”)

3.1.2 Install your Package

  • Make the necessary configurations to make your package named istec-p4 locally instalable.
  • Install your package locally in the virtual environment you are using.
  • To be locally instalable means, you will install your package in any of your virtual environments, and then, from any other project using the same environment, you can call your package/modules like this:
from istec.p4.exercises import greetings
  • Once you load your package then you can call the existing functions within the package.