Python SQLite Connection

import sqlite3

try:
    sqliteConnection = sqlite3.connect('SQLite_Python.db')
    cursor = sqliteConnection.cursor()
    print("Database created and Successfully Connected to SQLite")

    sqlite_select_Query = "select sqlite_version();"
    cursor.execute(sqlite_select_Query)
    record = cursor.fetchall()
    print("SQLite Database Version is: ", record)
    cursor.close()

except sqlite3.Error as error:
    print("Error while connecting to sqlite", error)
finally:
    if (sqliteConnection):
        sqliteConnection.close()
        print("The SQLite connection is closed")

Text to speech using python

#Import the required module for text
#to speech conversion
from gtts import gTTS

#This module is imported so that we can
#play the converted audio
import os

#The text that you want to convert to audio
mytext='There is nothing either good or bad, but thinking makes it so.'

#Language in which you want to convert
language='en'

#Passing the text and language to the engine,
#here we have marked slow=False.Whichtells
#the module that the converted audio should
#have a high speed
myobj=gTTS(text=mytext,lang=language,slow=False)

#Saving the converted audio in a mp3 file named #welcome
myobj.save("texttospeech.mp3")

#Playing the converted file
os.system("mpg321 texttospeech.mp3")