last day (15 days later) » 

5:25 AM
0
A: Insert image using xlwt Python Odoo?

arryphThis ValueError: need more than 3 values to unpack error is probably happening because img.split() is returning a tuple of less than 4 items, while you are unpacking to 4 variables, r g b a. Check the length of img.split() return and assign to variable accordingly, or use indexing to access first...

 
Thanks for the reply.. I have applied the above solution and getting this error now: IOError: [Errno 13] Permission denied: 'imagetoadd.bmp'. I have given full permissions to my module with chmod but still same permission error.
 
Because your current working directory of your python process is not your module path, but somewhere else. As in this problem, you don't really need persistent file but to insert in excel file, you should use BytesIO instead of a file name to save to, which will create required bitmap image in memory and you can call insert_bitmap() with that file.
 
Can you update the answer plz? as I dont know the proper syntax
is it not possible using xlwt? bcoz I need to change the full code for using xlsxwriter
 
can't find documentation for xlwt
did you find my last update useful?
 
Trying your last update and it gives me this error: AttributeError: 'Worksheet' object has no attribute 'insert_bitmap_data'
 
5:25 AM
are you using latest version version of xlwt?? i tested this code, working with no error
pip freeze|grep xlwt
xlwt==1.3.0
 
Yes Bro you first of all many thanks for the extended awesome support
 
no problem
 
xlwt==0.7.5
 
that's way older
run "pip install -U xlwt"
 
5:49 AM
You are really really really genius!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111111
 
glad that i could help. cheers.
 

last day (15 days later) »