पैकेजों में फ़ंक्शनालिटी जोड़ना

Python में Software Engineering Principles

Adam Spannbauer

Machine Learning Engineer at Eastman

पैकेज संरचना

पैकेज संरचना

Python में Software Engineering Principles

फ़ंक्शनालिटी जोड़ना

work_dir/my_package/utils.py में काम कर रहे हैं

def we_need_to_talk(break_up=False):
    """Helper for communicating with significant other"""
    if break_up:
        print("It's not you, it's me...")
    else:
        print('I <3 U!')

work_dir/my_script.py में काम कर रहे हैं

# Import utils submodule
import my_package.utils

# Decide to start seeing other people
my_package.utils.we_need_to_talk(break_up=True)
It's not you, it's me...
Python में Software Engineering Principles

__init__.py से फ़ंक्शनालिटी इम्पोर्ट करना

work_dir/my_package/__init__.py में काम कर रहे हैं

from .utils import we_need_to_talk

work_dir/my_script.py में काम कर रहे हैं

# Import custom package
import my_package

# Realize you're with your soulmate
my_package.we_need_to_talk(break_up=False)
I <3 U!
Python में Software Engineering Principles

पैकेज संरचना बढ़ाना

विस्तारित पैकेज संरचना

Python में Software Engineering Principles

पैकेज संरचना बढ़ाना

सबपैकेज संरचना

Python में Software Engineering Principles

अभ्यास करते हैं!

Python में Software Engineering Principles

Preparing Video For Download...