This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gtts import gTTS | |
import os | |
str = input("Please enter the text to convert it into audio file \n", ) # taking input from the user to convert it into audio file | |
txt = str | |
# txt="hello world" | |
lan = 'en' | |
output = gTTS(text=txt, lang=lan, slow=False) | |
output.save("txt2sph.mp3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gtts import gTTS | |
import os | |
# mytext="Text to speech conversion using python" | |
# to convert file text into mp3 file output | |
# create a var to handle and open the file | |
fh = open("test.txt", "r") # this variable is used to open the file,open is the function to open file, | |
# hve to create test.txt file by ourslf | |
mytext = fh.read().replace("\n", " ") # varible to read the file leaving out new lines & spaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GET YOUR LINE PRINTED BACKWARDS | |
print("Enter the string you want to print backward") | |
str1 = input() | |
print("String entered by you as follows\n", str1) | |
print("String entered by you in upper case as follows\n", str1.upper()) | |
print("String entered by you in lower as follows\n", str1.lower()) | |
x = int(len(str1)) | |
print("Length of the string: ", x) | |
i = x | |
print(type(i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#THIS THE BASIC CALCULATOR WHICH OPTIONS TO SELECT FROM. | |
print("WELCOME TO THE PYTHON CALCULATOR") | |
a= int( input("enter your FIRST NO. ", )) | |
b= int(input("enter your SECOND NO. ", )) | |
print("SELECT M FOR MULTIPLICATION OF TWO NOS. \nSELECT D FOR DIVISION OF TWO NOS. \nSELECT A FOR ADDITION OF TWO NOS.\nSELECT S FOR SUBSTRACTION OF TWO NOS.") | |
x=input("ENTER YOUR CHOICE ",) | |
print(x) | |
if x == "m" or x == "M" : | |
print(a*b) | |
elif x == "d" or x == "D": |