3 Amazing Python Modules For Intermediate Python Programmers

 3 Amazing Python Modules For Intermediate Python Programmers !


Hello people. In this post we will discuss about 3 amazing modules in python that you need to try if have basic knowledge in python. Before getting started let me ensure one thing, Here all 3 modules have same priority. 


Okay, Lets Get Started !

1) tkinter :

    tkinter is an amazing module in python which is used for creating Graphical User Interface applications in Python. Here the important thing is there is no need to install tkinter form external source. It is included by default with installation of Python in Windows, Linux and Mac. 

Now I'll show you the basic code to open a window in tkinter.

from tkinter import *
window = Tk()
window.geometry("450x400")
window.title("Tkinter Tutorial")
label = Label(window, text= "Hello Programmers",bg="red", font=("Times New Roman",25))
label.pack()
window.mainloop()

The output of the above code will be as follows : 


Okay, now if you want to learn more about this tkinter module then refer the below youtube video.



2) speech_recognition :

    speech_recognition module is used to convert our speech into text in Python Programming Language. In order to use speech_recognition module it must be installed using 'pip'. The command is as follows : pip install speechRecognition
    For more details about installation visit : https://pypi.org/project/SpeechRecognition/ 

Now I'll show you the basic code for conversion of speech into text in Python Programming Language:

import speech_recognition as sr
def take_command():
    r = sr.Recognizer()
    with sr.Microphone() as source:
        print(" -- Iam Listening --")
        audio = r.listen(source)
    try:
        print(" -- Iam Recognizing --")
        speech = r.recognize_google(audio)
        print(f" Your Speech Is : {speech}")
    except:
        print("Iam Unable to recognise")
take_command()

Okay, now if you want to learn more about this speech_recognition module then refer the below youtube video.



3) pyttsx3 : 

    pyttsx3 module in Python is used for conversion of Text into Speech. Any text that is given ad input in the code will be converted into speech using this module. This module can also be installed using 'pip' command. The command will be as follows : pip install pyttsx3
    For more details about installation visit : https://pypi.org/project/pyttsx3/

Now I'll show you the basic code for conversion of text into speech in Python Programming Language:

import pyttsx3
engine = pyttsx3.init('sapi5')
voice = engine.getProperty('voices')
engine.setProperty('voice', voice[1].id)
volume = engine.getProperty('rate')
engine.setProperty('rate',130)
def speak(text):
    engine.say(text)
    engine.runAndWait()
speak("Welcome to the world of python")

Okay, now if you want to learn more about this pyttsx3 module then refer the below youtube video.



Well ! That's all for now Guys... Hope you find this useful and interesting. In our upcoming posts we will once again discuss about another 3 amazing modules of Python.


Comments