Changing filenames from Greeklish => Greek (subprocess complain)
Νικόλαος Κούρας
nikos.gr33k at gmail.com
Thu Jun 6 07:31:49 EDT 2013
# Compute a set of current fullpaths
fullpaths = os.listdir( '/home/nikos/public_html/data/apps/' )
# Load'em
for fullpath in fullpaths:
try:
# Check the presence of a file against the database and insert if it doesn't exist
cur.execute('''SELECT url FROM files WHERE url = %s''', fullpath.encode('utf-8') )
data = cur.fetchone() #URL is unique, so should only be one
print( fullpath.encode('utf-8') )
Now why this does not print out the filenames when iterated in the for loop?
One step forward is that when i run it liek this no error is being displyed in the error log.
Please help, i ahve tried os.listdir() as Cameron suggested.
More information about the Python-list
mailing list