Course
Python Modules Tutorial: Importing, Writing, and Using Them
Learn how to create and import Python modules. Discover best practices, examples, and tips for writing reusable, organized, and efficient Python code!
Updated Mar 28, 2025 · 8 min read
Learn Python From Scratch
Master Python for data science and gain in-demand skills.
Can I import a module inside a function?
What happens if two modules have the same name?
Do I need to compile my module to .pyc manually?
How can I check where a module is being imported from?
Is it okay to use from module import *?
Can I reload a module after editing it?
Topics
Learn more about Python with these courses!
4 hr
6.1M
Course
Introduction to Data Science in Python
4 hr
474.9K
Course
Intermediate Python
4 hr
1.2M
See More
RelatedSee MoreSee More
blog
6 Python Best Practices for Better Code
Discover the Python coding best practices for writing best-in-class Python scripts.
Javier Canales Luna
13 min
Tutorial
How to Document Python Code
Learn why there is a need for documenting code and best practices to do it. Further, learn to leverage the potential of the Pydoc module for documenting purposes.
Aditya Sharma
14 min
Tutorial
Python Excel: A Guide With Examples
Learn how to read and import Excel files in Python, write data to these spreadsheets, and find the best packages to do this.
Natassha Selvaraj
15 min
Tutorial
Python Tutorial for Beginners
Get a step-by-step guide on how to install Python and use it for basic data science functions.
Matthew Przybyla
12 min
Tutorial
Python Functions: How to Call & Write Functions
Discover how to write reusable and efficient Python functions. Master parameters, return statements, and advanced topics like lambda functions. Organize your code better with main() and other best practices.
Karlijn Willems
14 min
Tutorial
Pip Python Tutorial for Package Management
Learn about Pip, a powerful tool that helps you properly manage distribution packages in Python.
Javier Canales Luna
11 min