My Code :
%gui qt
from PyQt5.QtWidgets import QFileDialog
def gui_fname(dir=None):
"""Select a file via a dialog and return the file name."""
if dir is None: dir ='./'
fname = QFileDialog.getOpenFileName(None, "Select data file...",
dir, filter="All files (*);; SM Files (*.sm)")
return fname[0]
from IPython.display import display
button = widgets.Button(description="Open The File !!")
button.style.button_color = 'yellow'
display(button)
def on_button_clicked(b):
print("Button clicked.")
f=gui_fname()
#import fileplot
#fileplot.load_file(f)
button.on_click(on_button_clicked)
#b1 = Button(description='Open File !!')
#b1.style.button_color = 'yellow'
#b1.on_click(on_button_clicked)
#b1
Problem : It works fine in local pc python version 2.7 os Linux
But when i try to implement it remotely in Azure Jupyter Notebook It's kernel dies every time i run the code and i am not able to get the results . Is there any other way by which i can implement a file dialog box with html5 widgets in ipython widgets ??
What i need I need the user to Choose the file that is in His/Her pc which is locally aviable.1