我想用widgets.FileUpload
创建一个事件,就像我用widgets.Button
创建一个事件一样。有没有办法做这样的事
import ipywidgets as widgets
def do_something_with_file(fu):
content = fu.data[0].decode('utf-8')
# doing something with the file content and get some string output
return 'some string'
str_file_upload = widgets.FileUpload(accept='.txt', multiple=False)
str_file_upload.on_upload(do_something_with_file)
目前没有回答
相关问题 更多 >
编程相关推荐