python - Image file is not of type1 -
so i'm here running program on ssh secure shell , xming, when try display ".jpg" or ".bmp" image file on it, returns error: "image file not of type 1". mean? program runs fine on computer, when running through server. code written in python. thanks!
here front of code:
import wx print wx.version() import searchseq import sys wx.lib.pubsub import publisher decimal import * import math import wx.lib.sheet sheet id_about = 1 id_exit = 2 class rewindow(wx.frame): def __init__(self, parent, id): wx.frame.__init__(self,parent,id, 'restriction enzyme window', size = (800, 500)) #creat panel panel = wx.panel(self) #insert picture pic = wx.image("dna.bmp", wx.bitmap_type_bmp).converttobitmap() self.button = wx.bitmapbutton(panel, -1, pic, pos = (630,250)) self.button.bind(wx.evt_button, self.runit)
the error message "image file not of type 1" means image try display not bmp file. 1 value of wx.bitmap_type_bmp constant.
to confirm, type :
import wx print wx.bitmap_type_bmp >>> 1 wx can't find "dna.bmp" image, should use absolute path find/load image.
edit :
when told python load "dna.bmp", current directory, , this, running on server or through ssh connection can different, using absolute path eliminate problem.
Comments
Post a Comment