I am trying to have the Upload(N) button of the FileUpload widget from Ipywidgets to reset the number N after i uploaded some files, but I'm not sure how. I am using Jupiter notebook with:
uploader=widgets.FileUpload(
accept='*.csv', # Accepted file extension e.g. '.txt', '.pdf', 'image/*', 'image/*,.pdf'
multiple=True # True to accept multiple files upload else False
)
def update_list_files(*args):
global glob_list_f #if i make the variable global then i can take it out of the function.
glob_list_f = list(uploader.value.keys())
uploader.observe(update_list_files, 'value')
uploader
If I select 3 files it yields : Upload(3)
Now If I select 3 other files it yields: Upload(6)
The wanted behaviour would be Upload(3) again.