convert a PIL Image to a wx image

def PILTowx(pimg):
    '''convert a PIL Image to a wx image'''
    from wx_loader import wx
    wimg = wx.EmptyImage(pimg.size[0], pimg.size[1])
    wimg.SetData(pimg.convert('RGB').tostring())
    return wimg