Posts

Showing posts from February, 2022

Try Except Else Finally

  Try Except Else Finally

Python Path

Python Path 

Structure Python Projects

 Structure Python Projects: Best Practices Points to be covered : using logging appropriately,  writing unit tests,  git for version control with the appropriate workflow,  running automated tests with Travis CI,  generating documentation using Sphinx    structuring files and code as close to PEP-8 guidelines  Intense python web application

What is the difference between __init__.py and setup.py and __main.py

 When using function as modules, they use a setup.py files, but when I use pycharm, it generates a   init .py. So my question is. What is the difference between a module and a package in python. What is the difference between  init .py & setup.py? __main .py A module is a single .py file. A package is a directory that contains a file named  __init__.py  and usually other files as well, but which acts like a module. It's imported the same way you import a single file module (except you import by the directory name not by a file name), and it acts like a single module, even though the implementation can be split among many files/submodules. setup.py  is used by distutils/setuptools and is concerned with building, distributing, and installing the module. For example, it's where dependencies are stated so that when you use a tool like pip to install a package, it can also ensure you have all the dependencies installed, or fetch and install them if you don't...