© Sanjib Sinha 2017

Sanjib Sinha, Beginning Ethical Hacking with Python, 10.1007/978-1-4842-2541-7_20

20. Module

Sanjib Sinha

(1)Howrah, West Bengal, India

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 ...

Get Beginning Ethical Hacking with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.