#!/usr/bin/env python # coding: utf-8 # In[ ]: import sys, os sys.path.insert(0, os.path.abspath('..')) import ipywe.fileselector # # Single file selector # In[ ]: fsel= ipywe.fileselector.FileSelectorPanel(instruction='select file', start_dir='.') fsel.show() # In[ ]: print fsel.selected # # Single directory selector # In[ ]: fsel= ipywe.fileselector.FileSelectorPanel(instruction='select file', start_dir='.', type='directory') fsel.show() # In[ ]: print fsel.selected # # Multiple files selector # In[ ]: fsel= ipywe.fileselector.FileSelectorPanel(instruction='select file', start_dir='.', multiple=True) fsel.show() # In[ ]: print fsel.selected # # Multiple directories selector # In[ ]: fsel= ipywe.fileselector.FileSelectorPanel(instruction='select file', start_dir='.', type='directory', multiple=True) fsel.show() # In[ ]: print fsel.selected # # Single file selector with callback # In[ ]: def callback(selected): print selected fsel= ipywe.fileselector.FileSelectorPanel(instruction='select file', start_dir='.', next=callback) fsel.show()