Skip to main content

Posts

Showing posts from August, 2020

5 Unique and Useful Python modules.

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 internet is connected to your device. You can even control the number of sentences that you

Never Lose a Game of Chess | Python Chess Hack

Motive            I lost every game that I played chess with my friends. So why not cheat, even though  it was not the best option, I had to somehow prove that I was not dumb and can even win against them. Since they play online with me, I had a better chance to cheat so I thought of creating an ai to play against them but it was not that easy so I started surfing through the internet to find a better way. Then I found stockfish it was a chess engine that generates the best move for us. So I used it as my AI. Again, luck was with me I was able to find a module called chess in python that helped me a lot and now my work was really very easy. At last, I created the program and won the games against them but they had figured out that I was cheating and my friends started mocking at me. Then I understood that I was wrong and I shouldn't have cheated and started working hard for it and now I literally can win matches with them even though I lost many of t