Python Imaging Library (PIL) question
Hi, I am tryin to copy an image into my own data structure(a sort of 2d array for further FFT). I've banged my head over the code for a couple of hours now. The simplified version of my problem is below. #-Code import Image pic = Image.open("Images/a.jpg") (picdata,width,height) = (pic.load(),pic.size[0],pic.size[1]) picMap = [[0] * width ] * height#matrix needed for FFT print "--Printing PIC MAP--" for h in range(0,height): for w in range(0,width): print picMap[h][w]," ", #everything initialized to ZERO...this is ok print "\n" print "--Copying to PIC MAP--" for h in range(0, height): for w in range(0, width): picMap[h][w] = picdata[w,h] #problem lies here print picMap[h][w]," ", #Seems to copy perfectly here as the output shows print "\n" print "--Printing PIC MAP AGAIN--" for h in range(0,height): for w in range(0,width): print picMap[h][w]," ", #Should print the values as above, but doesn't print "\n" #-Code End---- Hopefully someone would take a look and let me know what i'm doing something wrong here. Thanks a lot -Sid -- http://mail.python.org/mailman/listinfo/python-list
testing...(Sorry)
. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Imaging Library (PIL) question
The problem is likely to do with the line picMap = [[0] * width ] * height yeah the problem was with that specific line. The snippet from your link worked by replacing the previous declaration by picMap = [[0] * 3 for x in xrange(height)] Thanks, -Sid -- http://mail.python.org/mailman/listinfo/python-list
Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence
Hi All, I have a list of scripts which are present in various folders and this may be present in one of their sub-folder too. There are 1000s of folders and hence parsing through each folder/sub-folder is not an option. So I was trying to dir /s /b using python. Now since the file's path name is computed using other part of the code, I am feeding in a variable here and somehow it does not seem to work.. :( Intent is to run following command from python dir /s /b "c:/abc/def/ghjmain\features\XYZ\*" My present code. import subprocess for row in range(1,max_row): tempID_cell = "C" + str(row); tempID = ws[tempID_cell].value; print (tempID); Command = "c:\\abc\\def\\ghj\\main\\features\\XYZ\\*" + str(tempID) + ".cli"; print (Command); IsPresent = subprocess.check_output("dir /s /b Command", shell=True); Any help would really be appreciated. Regards, Siddharth -- https://mail.python.org/mailman/listinfo/python-list
Adding Microsoft objects in Boa Constuctor Palette
This is what I wanted to do: Add Microsoft Active objects like Excel sheets and Word files to the Palette in Boa Constructor. There is a User tab in the GUI builder menu, but I'm not sure how to use/enable it. 1. Does anyone know how to do this? 2. Is anyone aware of any work that is currently going on to support adding Microsoft objects in Boa. 3. Does any other Python GUI creator/editor exist out there that can do this? 4. How would one add an excel sheet to a wx.Panel in general w/ or w/o Boa? Looking forward to replies... -SK -- http://mail.python.org/mailman/listinfo/python-list
Re: Adding Microsoft objects in Boa Constuctor Palette
On Aug 7, 10:13 am, TheSeeker <[EMAIL PROTECTED]> wrote: > On Aug 6, 5:59 pm, Sid K <[EMAIL PROTECTED]> wrote: > > > > > This is what I wanted to do: > > > Add Microsoft Active objects like Excel sheets and Word files to the > > Palette in Boa Constructor. There is a User tab in the GUI builder > > menu, but I'm not sure how to use/enable it. > > > 1. Does anyone know how to do this? > > 2. Is anyone aware of any work that is currently going on to support > > adding Microsoft objects in Boa. > > 3. Does any other Python GUI creator/editor exist out there that can > > do this? > > 4. How would one add an excel sheet to a wx.Panel in general w/ or w/o > > Boa? > > > Looking forward to replies... > > > -SK > > Hi, > > You might get a response by trying the wxPython list: wxPython- > [EMAIL PROTECTED] or the Boa list: boa-constructor- > [EMAIL PROTECTED] > > Duane Hey Duane, Thanks for the tip. SK -- http://mail.python.org/mailman/listinfo/python-list