Changing filenames from Greeklish => Greek (subprocess complain)
Νικόλαος Κούρας
nikos.gr33k at gmail.com
Tue Jun 4 14:33:26 EDT 2013
Τη Τρίτη, 4 Ιουνίου 2013 9:18:29 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
> Νικόλαος Κούρας <nikos.gr33k at gmail.com> writes:
> >>> from collections import Counter
> >>> stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, )"
> >>> chars_count = Counter(stmt)
> >>> print("Number of '(': %d" % chars_count['('])
> >>> print("Number of ')': %d" % chars_count[')'])
> Number of '(': 2
> Number of ')': 1
Hello Lele, you have proven helpfull many times lets hope once more:
# Compute a set of current fullpaths
fullpaths = set()
path = "/home/nikos/www/data/apps/"
for root, dirs, files in os.walk(path):
for fullpath in files:
fullpaths.add( os.path.join(root, fullpath) )
stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, )"
chars_count = Counter(stmt)
print("Number of '(': %d" % chars_count['('])
print("Number of ')': %d" % chars_count[')'])
sys.exit(0)
outputs this:
http://superhost.gr/cgi-bin/files.py
I dont even understand what that means though.
More information about the Python-list
mailing list