About 45,300,000 results
Open links in new tab
  1. How to write a Python module/package? - Stack Overflow

    Apr 1, 2013 · A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py. create hello.py then write the following function as its content: …

  2. Create and Import modules in Python - GeeksforGeeks

    Dec 29, 2019 · In Python, modules allow us to organize code into reusable files, making it easy to import and use functions, classes, and variables from other scripts. Importing a module in …

  3. How to Build Your Very First Python Package - freeCodeCamp.org

    Oct 27, 2020 · We’re going to build a very simple module and make it available to anyone around the world. The contents of this module follow a very basic structure. There are, in total, four …

  4. Python Modules - W3Schools

    Create a Module. To create a module just save the code you want in a file with the file extension .py:

  5. 6. ModulesPython 3.13.3 documentation

    3 days ago · A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. Within a module, the module’s name (as a string) …

  6. How To Write Modules in Python 3 - DigitalOcean

    Aug 20, 2021 · Python modules are .py files that consist of Python code. Any Python file can be referenced as a module. Some modules are available through the Python Standard Library …

  7. How to Write a Custom Module in Python | LearnPython.com

    Oct 28, 2021 · Writing custom modules in Python is helpful for breaking down large parts of a program into smaller, more manageable, and organized files. It also increases the code …

  8. Python Packages: Structure Code By Bundling Your Modules

    Oct 11, 2024 · We’ll look at what packages are, how they are structured, and how to create a Python package. You’ll also discover how packages and modules work together to organize …

  9. Python Modules (With Examples) - Programiz

    Let us create a module. Type the following and save it as example.py. result = a + b. return result. Here, we have defined a function add() inside a module named example. The function takes in …

  10. Python Modules: How to Use and Create Modules in Python

    Feb 22, 2024 · In this article, we will explain what Python modules are, how to use them, and how to create your own. We’ll also provide practical examples to showcase their importance in …

  11. Some results have been removed