(('aac',), ('aif',), ('ape',), ('flac',)
I'm getting an error message about my regular expression, which I'm not really sure about:
<class 'sre_constants.error'>: nothing to repeat
Can you point out the mistake in my logic and or syntax?
I'd also accept an alternative method that would achieve the same thing.
Thanks ahead of time.
print "Content-Type: text/html"
db = MySQLdb.connect('localhost', 'root', 'rootpass', 'ccs', 3307)
extensions = 
c.execute("""SELECT ext FROM fileext WHERE filetypeid=2""")
extensions = c.fetchall()
path = 'H:\\'
allfiles = 
for root,dir,files in os.walk(path):
filelist = [os.path.join(root,fi) for fi in files]
for f in filelist:
for ext in extensions:
if re.search(fi, str(ext)):
filesize = os.stat(file).st_size
c.execute("""SELECT*FROM musicfiles WHERE (filepath, filesize) = (%s, %s)""", (file, filesize,))
row = c.fetchone()
print "No matches."
print "<title>Scan Music Folders</title>"