In Python when you leave the shell or terminal or Python interpreter, the script is lost. After all, you don’t write programs to lose at the end of the day. It may be a simple calculator program. But you want to use it again. Another important thing is you need to use your one code in your other code. You may want to use other people’s code also.
To solve this dilemma, the concept of “module” comes in.
You write a simple calculator program and save the file as “cal.py”. If you are in the root directory of your project you can easily use your calculator in your other program. Once you write a Python ...