def get_filepaths(wildcard=''):
    """ dialog box to select files

    Opens a dialog box from which the user can select files

    Parameters
    ----------
    wildcard : string, optional
        Only show file types of this kind. Default wildcard="" which means
        no file type filtering.
        e.g. "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"

    Returns
    -------
    filepaths: list of paths
        List of user selected file paths.  Will return None if the cancel
        button was selected.

    """
    try:
        try:
            from PyQt5 import QtGui
        except ImportError:
            from PyQt4 import QtGui
        app = QtGui.QApplication([])
        caption = 'Select file(s)'
        directory = './'
        filter_mask = wildcard
        filepaths = QtGui.QFileDialog.getOpenFileNames(None, caption,
            directory, filter_mask)
        if len(filepaths) == 0:
            filepaths = None
    except ImportError:
        import wx
        app = wx.App(None)
        style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
        dialog = wx.FileDialog(None, 'Open', wildcard=wildcard, style=style)
        if dialog.ShowModal() == wx.ID_OK:
            filepaths = dialog.GetPaths()
        else:
            filepaths = None
            dialog.Destroy()
    return filepaths
