i have a variable data which have a value of [('01:02,02:52,03:30,03:31',)], and a srt file with some of its content be like:
23
00:00:59,025 --> 00:01:06,042
can read and display documents that
24
00:01:02,016 --> 00:01:08,225
contain<font color="#E5E5E5"> HTML so Firefox Google Internet</font>
25
00:01:06,042 --> 00:01:09,851
<font color="#CCCCCC">Explorer they all do the same thing</font>
26
00:01:08,369 --> 00:01:12,630
<font color="#E5E5E5">they're going</font><font color="#CCCCCC">
to</font><font color="#E5E5E5"> take that</font><font color="#CCCCCC">
document and</font>
now i want to check if any element of my data eg: 01:02 or 03:30 or any other separately is present in the srt file or not. For eg: 01:02 is present below 24 numbered 00:01:02,016 --> 00:01:08,225
here is python file but no outcome:
import mysql.connector
import numpy as np
conn= mysql.connector.connect
(user="root",password="",host="localhost",database="videojs")
# prepare a cursor object using cursor() method
cursor = conn.cursor()
def read_from_db():
cursor.execute("select time_arr from info where id ='52'")
data=cursor.fetchall()
print(data)
#Open the file
fobj = open("one.srt")
text = fobj.read().strip().split()
#Conditions
while True:
s = input("Enter a string: ") #Takes input of a string from user
if s == "": #if no value is entered for the string
continue
if s in text: #string in present in the text file
print("Matched")
break
else: #string is absent in the text file
print("No such string found,try again")
continue
fobj.close()
read_from_db()
please help me out....