@vinaymavi

Agenda

  • Module
  • Package
  • PYTHON_PATH
  • pip
  • Some useful packages 
  • Virtual environment 

Module

A module is a piece of software that contains logically separated code.

Module

# Syntax

import <mobule_name/package_name>

from <module_name/package_name> import <module_name/package_name/other>

Module


#utils.py
def print_msg(msg):
    print msg
# Inside Another Programs
import utils
utils.print_msg("Hello Team")

Package

A package is folder structure that provide name spacing to modules.

Package

A normal directory that contains __init__.py file called package in python.

Package

__init__.py

How Import Works?

pip

Some useful packages

  • logging
  • os
  • sys
  • utils
  • datatime

Virtual Environment

Python4

By Vinay Mavi

Python4

This slides contains information about package system how it is work and how we can publish packages to pip.

  • 143