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,870 points
115 views

1 answer to this question.

0 votes
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,160 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
• 56,520 points
213 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
• 56,520 points
494 views
0 votes
1 answer

In Python, what is difference between Array and List?

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

answered Mar 15 in Python by Taj
• 1,040 points

edited Mar 18 by Omkar 2,633 views
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
• 56,520 points
73 views
+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 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 216 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 in Python by SDeb
• 13,160 points
130 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,160 points
31 views