LINUX.ORG.RU

История изменений

Исправление tz4678, (текущая версия) :

for file in files:
  with open(file, 'r+') as fp:
    contents = fp.read()
    contents = contents.replace('<a href="#', '<a href="file.html#') 
    fp.seek(0)
    fp.write(contents)

Исходная версия tz4678, :

for file in files:
  with open(file, 'r+b') as fp:
    contents = fp.read()
    contents = contents.replace('<a href="#', '<a href="file.html#') 
    fp.seek(0)
    fp.write(contents)