Importing modules
Modules in Python are importable objects that can allow you to borrow other people's code for your own project in a simple way. An example of using this to our advantage looks like this.
As you can see, we have imported the os module and used the system function from the module to run a command in the command line. Now you can instead of importing the entire module import only a specific function by using the from statement.
now instead of it caching the entire module into the RAM it only imports the system function.
Last updated
Was this helpful?