--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To post to this group, send an email to python...@googlegroups.com.
To unsubscribe from this group, send email to python-excel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/python-excel?hl=en-GB.
xlrd is showing exactly what Excel put into the file.
See if you can find some documentation on the web about how the winner is determined when two non-None sides conflict. If that fails, write an xlwt script to create a file with the nC2 combinations, eyeball the result, and fill in the answers. I'll add it to one or both of the xlrd / xlwt distributions.
What difference are you referring to? Excel wrote some border values
into the file; xlrd read them out exactly. You acknowledge this, so
where's the difference?
>> See if you can find some documentation on the web
>> about how the winner is determined when two non-None
>> sides conflict. If that fails, write an xlwt script to create a
>> file with the nC2 combinations, eyeball the result, and
>> fill in the answers. I'll add it to one or both of the xlrd / xlwt
>> distributions.
>
> The winner is determined by the last user's choice, no
> question about that.
Well, that doesn't really have much meaning in terms of the file.
Excel, upon loading a file, cannot tell what the "last user's choice"
was. What it can do is just read what's in the file. So what John is
asking you is: If the *file* contains conflicting border values, what
does *Excel* show?
> I meant no disrespect or criticism, my questions were just for
> my own understanding, I'll dig down into the xlrd source code
> to see if anything can be done about it. However, the general
> atmosphere in the Python-Excel group just makes me think
> that whatever I will come up with will just be not good enough.
What do you mean by "done about it"? It would be wrong for xlrd to
report values other than what's there (in files written by Excel
itself), so I am not sure what more can be done besides documenting
what happens in potentially contentious scenarios, which is what John
seems to be offering to do.
As far as the atmosphere here, I admit it can seem a bit on the tough
side, but try not to take anything personally. Most of the people
here are (1) busy and (2) have a matter-of-fact style of
communication. It's not meant to be unhelpful or uncooperative or
disparaging. It's just usually not very coddling.
John Y.
On Mon, Aug 8, 2011 at 6:11 PM, Andrea Gavana <andrea...@gmail.com> wrote:What difference are you referring to? Excel wrote some border values
>
> On 7 August 2011 15:41, John Machin wrote:
>>
>> xlrd is showing exactly what Excel put into the file.
>
> I don't have any doubt about that, I just wanted to
> understand why there was that difference.
into the file; xlrd read them out exactly. You acknowledge this, so
where's the difference?
Well, that doesn't really have much meaning in terms of the file.
>> See if you can find some documentation on the web
>> about how the winner is determined when two non-None
>> sides conflict. If that fails, write an xlwt script to create a
>> file with the nC2 combinations, eyeball the result, and
>> fill in the answers. I'll add it to one or both of the xlrd / xlwt
>> distributions.
>
> The winner is determined by the last user's choice, no
> question about that.
Excel, upon loading a file, cannot tell what the "last user's choice"
was. What it can do is just read what's in the file. So what John is
asking you is: If the *file* contains conflicting border values, what
does *Excel* show?
On Tue, Aug 9, 2011 at 3:37 AM, Andrea Gavana <andrea...@gmail.com> wrote:
> Now, the original question [from John Machin] was:
>
> "See if you can find some documentation on the web
> about how the winner is determined when two non-None
> sides conflict. "
>
> My answer to this question is that this situation is
> impossible whatever implementation you adopt in xlrd:
>
> There is no possible conflict between shared border
> styles, because either they are explicitly separated (as
> it is in the current implementation, the border is set for
> one cell and for the other is set to None), or they are
> forced to be exactly the same (as in this imaginary
> alternative implementation).
I guess we all gave up trying to make Andrea understand that Excel
files can be generated by a number of different programs, not limited
to Excel, and not even limited to platforms on which Excel can run;
and that there is a huge difference between what is actually stored in
an Excel file (which xlrd reads faithfully and without prejudice) and
what the Excel program presents to the user.
I was actually going to take a stab at another explanation, but then
decided it would be better if I simply tried to do some testing myself
with xlwt. And I've only now gotten around to it.
Attached is a simple exploratory program and the Excel file it
generates on my PC. It's by no means exhaustive, but what I gather
from it are
1. Border thickness is the first tiebreaker in conflicts. Thicker
wins. Dotted is thinner than thin. Whichever side has the thicker
border gets all its border attributes displayed by Excel (I'm using
2010 on Windows XP).
2. Colors seem to have a fixed pecking order. I only tried a few:
black > blue > red.
Again, far from exhaustive, but enough for my purposes. If I later
find cases that go against these behavior patterns, or if I do more
complete testing, I'll share my results then.
John Y.