© 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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.