Python Packages for Beginners

Python Packages are nothing but a namespace or a hierarchical file directory structure that may contain multiple python script,modules or sub-packages or Packages. They are nothing but a simple directories, but it contains a file called .This indicate that the folder or directory is the Python can keep file empty or may insert some code.

Python Packages

To Create Python Packages fallow the below steps:

  1. Create “Hello” directory/folder in Desktop [you can name it whatever you want ,create it in any folder/directory]
  2. Python Packages
  3. Now create 3 python file as shown in below images named as , ,
  4. contain a simple class based example
  5. Python Packages
  6. contains a simple function
  7. Python Packages
  8. contain import statement,that makes code available that define in and
  9. Python Packages
  10. Now create script outsite the “hello” directory [i.e in Desktop] and write code as given in image
  11. Python Packages
  12. We have created a package called “hello” and used it in script,now run the code in terminal as given in image,you will get the fallowing output .
  13. Python Packages

For more details you can visit python official website

Hope guys you will understand the concept of Python Packages clearly.Try to implement it with more code,and if you find any difficulty, feel free to drop a comment on this post.


  1. Kamal Thakur February 4, 2016
  2. sanad February 12, 2016