About 2,500,000 results
Open links in new tab
  1. 5. The import system — Python 3.13.3 documentation

    1 day ago · The import system¶ Python code in one module gains access to the code in another module by the process of importing it. The import statement is the most common way of invoking the import machinery, but it is not the only way. Functions such as importlib.import_module() and built-in __import__() can also be used to invoke the import machinery.

  2. How do I document a module in Python? - Stack Overflow

    Here is an Example Google Style Python Docstrings on how module can be documented. Basically there is an information about a module, how to execute it and information about module level variables and list of ToDo items.

  3. Import module in Python - GeeksforGeeks

    Mar 8, 2025 · 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 Python is similar to using #include in C/C++, providing access to pre-written code and built-in libraries.

  4. 6. Modules — Python 3.13.3 documentation

    2 days ago · There is a variant of the import statement that imports names from a module directly into the importing module’s namespace. For example: This does not introduce the module name from which the imports are taken in the local namespace (so in the example, fibo is not defined). There is even a variant to import all names that a module defines:

  5. Importing Python Functions from Other Scripts - GeeksforGeeks

    Apr 24, 2025 · Below are some of the examples by which we can understand how we can import Python functions from another Python file in Python: In this example, two scripts are involved. The first script (`operations.py`) contains function for addition and subtraction.

  6. Python import: Advanced Techniques and Tips – Real Python

    In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring your code effectively. Using imports properly will make you more productive, allowing you to reuse code while keeping your projects maintainable.

  7. Examples of Ways to Import Functions in Python from Another …

    May 3, 2024 · Import the function(s) from the file into another Python script using the import keyword and the file name without the .py extension (e.g. import myfunctions). Call the imported function(s) in the script using the function name as defined in the file (e.g., myfunctions.mod_function() ).

  8. Python Functions - Python Guides

    Real-World Examples. Functions are essential across various Python applications: ... Call a Function from Another File in Python; Import All Functions from a File in Python; ... Learn about Functions in Python: Create reusable blocks of code using the `def` keyword, pass arguments, return values, and organize your logic efficiently. ...

  9. How to import modules, packages, functions, etc. in Python

    May 12, 2023 · Using import <module_name>, a module is imported as an object of the module type. You can check which file is imported with print(<module_name>). You can access functions and constants defined in the module using the syntax <module_name>.<function_name> or <module_name>.<constant_name>.

  10. Understanding Python Imports: Types, Usage, and Examples

    Jan 1, 2025 · Here’s a simple guide to the types of imports in Python, complete with examples and tips on when to use each. 1. Standard Import. This imports an entire module, allowing access to its...

  11. Some results have been removed
Refresh