Python code running slow - code included - base64 encoding -


i trying base64 encode audio flac file.

sometimes code times out. works. ideas on doing wrong?

import base64 import urllib  def get_flac(uri=none):    try:        req = urllib.urlopen(uri)    except exception e:        print(e)    return req  def convert_base64(flac_file):    audio_read = flac_file.read()    return base64.b64encode(audio_read)  uri = none  try:    the_file = get_flac('https://host123d1qv.cloudconvert.com/download/~_9ifzt78vnkmvoupqux_1aqhm1w') except exception e:    print(e)  try:    con = convert_base64(the_file) except exception e:     print(e)  con 


Comments