Answers for "nameerror: name 'fileupload' is not defined"

0

nameerror: name 'fileupload' is not defined

def _upload():

    _upload_widget = fileupload.FileUploadWidget()

    def _cb(change):
        global file_contents
        decoded = io.StringIO(change['owner'].data.decode('utf-8'))
        filename = change['owner'].filename
        print('Uploaded `{}` ({:.2f} kB)'.format(
            filename, len(decoded.read()) / 2 **10))
        file_contents = decoded.getvalue()

    _upload_widget.observe(_cb, names='data')
    display(_upload_widget)

_upload()
Posted by: Guest on October-29-2020

Code answers related to "nameerror: name 'fileupload' is not defined"

Browse Popular Code Answers by Language