Difference between module and Package in Python

0 votes
What is the main difference between a Python package and Python module?
Nov 13, 2018 in Python by ana1504.k
• 7,910 points
1,355 views

1 answer to this question.

+1 vote
A module is basically a single file or number of files that are imported under one import and used. such as :

import my_module
 

Whereas, A package is a collection of modules in directories that give a package hierarchy. such as:

from my_package.timing.danger.internets import function_of_love
answered Nov 13, 2018 by SDeb
• 13,290 points

Related Questions In Python

+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 58,120 points
1,148 views
+1 vote
1 answer

What's the difference between eval, exec, and compile in Python?

exec is not an expression: a statement ...READ MORE

answered Aug 28, 2018 in Python by Priyaj
• 58,120 points
2,656 views
+1 vote
4 answers

In Python, what is difference between Array and List?

Lists and arrays are used in Python ...READ MORE

answered Mar 15, 2019 in Python by Taj
• 1,080 points

edited Mar 18, 2019 by Omkar 127,369 views
0 votes
5 answers
0 votes
1 answer

Python: Module vs package?

A package is represented by an imported ...READ MORE

answered Nov 13, 2018 in Python by Priyaj
• 58,120 points
284 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,179 views
0 votes
1 answer

Difference between Python float and numpy float32

Python's standard float type is a C ...READ MORE

answered Mar 4, 2019 in Python by SDeb
• 13,290 points
2,393 views
0 votes
2 answers

difference between class and instance attributes

Apart from the performance, there is a ...READ MORE

answered Sep 17, 2018 in Python by SDeb
• 13,290 points
222 views