Server-Side Scripting/Strings and Files/Python (Flask)

app.py
"   return result

def process_line(line): index = line.find("° F") if index < 0: return "Invalid file format"

try: fahrenheit = float(line[0:index]) except: return "Invalid temperature data"

celsius = (fahrenheit - 32) * 5 / 9 result = f" {fahrenheit} " result += f" {celsius:.1f} " return result

if __name__ == "__main__": app.run(host='0.0.0.0', port=5000)

Try It
Copy and paste the code above into the following free online development environment or use your own compiler / interpreter / IDE.
 * Repl.it