Posts

Showing posts from December, 2021

API TERMINOLOGY : Part-1

API TERMINOLOGY Q1: What is a Resource? Resource is a physical or virtual component, which supports/extends/represents/constructs a system. Consider a real time example of a Vehicle . Wheels, brakes, headlight, fuel tank etc all are resources of a Vehicle  . All resources have names, location and identifiers. Take another example of Google. Now append “/gmail” in the last of the base url “https://www.google.com/” as "https://www.google.com/gmail".  Google will launch Gmail Page:    https://www.google.com Base URL:  https://www.google.com    Resource: /gmail/about/#  Q2: What are Collections? Collections are simply groups of resources. You’ll find that we don’t mention any collections in the API documentation. That is because we offer singleton resources, which are independent and exist outside of any collections Q3: What is Endpoints/BaseUrl? API endpoint is the point of entry in a communication channel when two systems are interacting....

Converting Pdf Text in to Audio Files

Image
 Converting Pdf Text in to Audio Files: Libraries:- PyPDF , is a library in python that is used to read text from a pdf file. PyPDF2 · PyPI Pyttsx3 , is a text-to-speech convert library. pyttsx3 · PyPI Here we are using PyPDF library to read text from the pdf file and then we are converting the text into speech and save it as an audio file. Program: import pyttsx3 , PyPDF2 pdfrReader=PyPDF2.PdfFileReader( open ( 'File_1.pdf' , 'rb' )) audio=pyttsx3.init() for page_num in range (pdfrReader.numPages): text=pdfrReader.getPage(page_num).extractText() cleanText=text.strip().replace( ' \n ' , ' ' ) print (cleanText) audio.say(cleanText) audio.save_to_file(cleanText , 'File_1.mp3' ) audio.runAndWait() audio.stop() THANKS!!

How will you check if a class is a child of another class?

Image
- This is done by using a method called issubclass() provided by python. The method tells us if any class is a child of another class by returning true or false accordingly. - We can check if an object is an instance of a class by making use of isinstance() method: Example: class Parent (): pass class b (Parent): pass print ( issubclass (b , Parent)) #true print ( issubclass (Parent , b)) #False obj1=b() obj2=Parent() print ( "=======" ) print ( isinstance (obj2 , b)) #False print ( isinstance (obj2 , Parent)) #True THANKS!!

Introduction of Python

Image
            Introduction of Python           What is Python?    Python is a popular programming language. It was created by Guido van Rossum,    and released in 1991. It is used for:    web development (server-side),software development, mathematics, system scripting. What can Python do?    Python can be used on a server to create web applications.    Python can connect to database systems. It can also read and modify files.    Python can be used to handle big data and perform complex mathematics.    Python can be used for rapid prototyping, or for production-ready software development. Why Python?    Python is a high-level, interpreted, interactive and object-oriented scripting language.    Python is designed to be highly readable.    It uses English keywords frequently where as ...