Witam,
Proszę o pomoc w zrozumieniu na czym polega funkcja o poniższym kodzie:
def g():
global big
big = file('plik.txt').read()
N = len(big)
s = set()
for i in xrange(6, N):
c = big[i]
if ord(c) > 127 and c not in s:
print i, c, ord(c), big[max(0, i-10):min(N, i+10)]
s.add(c)
print s
print [ord(c) for c in s]
To jest umieszczone na końcu pliku .txt zawierającego eBooka. Tam jest też na początku taka wzmianka: This header should be the first thing seen when viewing this Project
Gutenberg file. Please do not remove it. Do not change or edit the header without written permission.
Do czego służy podana wyżej funkcja i ewentualnie jak ją wykonać? Ten skrypt jest niezbędny do zakończenia zadania którego odpowiedź jest w tym eBooku :-)