#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import webbrowser result = [] myradio_file = os.path.join(os.path.expanduser("~"), ".local/share/InternetRadioDeutsch/myradio.txt") myradio_webfile = os.path.join(os.path.expanduser("~"), ".local/share/InternetRadioDeutsch/myradio.html") myradio_text = open(myradio_file, 'r').read() theRadioList = myradio_text.splitlines() def getValues(): for line in theRadioList: if line.startswith("-- "): line = line.replace("-- ", "").replace(" --", "") result.append(f'

{line}

') else: textline = line.split(",") if len(textline) > 1: name = textline[0] url = textline[1] result.append(f"
  • {name}
  • ") return('\n'.join(result)) result = getValues() ### html html_top = """ Radio Player
    """ html_code = html_top html_code += result html_code += html_bottom with open(myradio_webfile, 'w', encoding='utf8') as f: f.write(html_code) f.close() webbrowser.open(myradio_webfile, 2)