Motive There are different types of modules in python which not everyone knows so we thought of introducing them to you guys. Let's start! Note: This is not a tutorial of how to use these but is to show that these modules also exist and if you want to know more you can visit there own page and if you want us to explain leave a comment below. Links to there page are also given below. Hope you found something useful. 1.Wikipedia Yes, there is a module called Wikipedia in python, you can easily install Wikipedia by pip install wikipedia . We cannot rely on this module for advanced use. It was designed for ease of use and simplicity. Learn More Here . Here is a simple example: import wikipedia wikiPython = wikipedia.summary("Python", sentences=2) print(wikiPython) One big disadvantage is that it works only if the interne...
Motive
This is just as a fun project which you can even use for other backend projects, who don't like python and programing with it so let's dive through the modules in python.
The Project
Let's start by importing the module which is pre-installed, UUID. You can learn more here. Now, let's import the module:
Now let's create a variable called mac and then get the MAC address and then format it into a string from a 48-bit number and the add a ':', colon after two digits:
Now let's print the MAC address after converting it with uppercase letters:
So that's it we have got our MAC address with just 4 lines of code.
Full Code
If you have any doubts or errors in the program feel free to comment down below and I will respond as early as possible. And if I have made any mistake please correct me in the comment box below. Don't forget to follow us for such python related content.
๐it has helped me a lot"""
ReplyDelete