rantingrick writes:
> On Sep 6, 5:00 pm, Bart Kastermans wrote:
>> rantingrick writes:
>> > Hmm, i can replace all that code with this...
>>
>> Because I stupidly forgot to repeat the original problem I had, and my
>> code doesn't show it (and doesn
rantingrick writes:
> Hmm, i can replace all that code with this...
Because I stupidly forgot to repeat the original problem I had, and my
code doesn't show it (and doesn't show the correct use of the function I
wrote). The code shows that I now know how to compute the number of
lines and item
I build on the suggestion by rantingrick, but took it in a bit
different direction.
I now have working code that performs reasonable. The reason for
the class lines (as opposed to just a function) is b/c font.measure
appears not that fast. So I want to remember between different
calls to lines.
rantingrick writes:
> On Sep 3, 5:15 pm, Bart Kastermans wrote:
>
>> Any suggestions?
>
> Yeah, have you considered using the "linespace()" method of tk.Font
> objects to calculate the height? Although i must say it "feels" as if
> your doing so
I have a label into which I am going to put content of different
sizes. I would like to know how high I need to make the label so that I
can size the window so it can stay the same for the different content
sizes. I have a strategy, but it seems more complicated then it should
be.
I want to set a
t...@thsu.org writes:
> On Sep 2, 9:54 am, Bart Kastermans wrote:
>> if d(a,b) == 1 and a < b:
>
> It will probably be faster if you reverse the evaluation order of that
> expression.
>
> if a
> That way the d() function is called less than half the time. Of cours
MRAB writes:
> On 02/09/2011 01:35, Bart Kastermans wrote:
>> graph = [[a,b] for a in data for b in data if d(a,b) ==1 and a< b]
>> graph2 = []
>> for i in range (0, len(data)):
>> for j in range(0,len(data)):
>> if d(data[i],data[j]) ==
In the following code I create the graph with vertices
sgb-words.txt (the file of 5 letter words from the
stanford graphbase), and an edge if two words differ
by one letter. The two methods I wrote seem to me to
likely perform the same computations, the list comprehension
is faster though (281
that in the future we can
# act on it).
#
# Bart Kastermans, www.bartk.nl
"""
Design of the window
+-
I have a file in which I am searching for the letter "i" (actually
a bit more general than that, arbitrary regular expressions could
occur) as long as it does not occur inside an expression that matches
\\.+?\b (something started by a backslash and including the word that
follows).
More concrete e
Paul McGuire <[EMAIL PROTECTED]> writes:
> On Jul 12, 6:18 am, Bart Kastermans <[EMAIL PROTECTED]
> macbook.local> wrote:
>> This uses the function:
>>
>> def NoneOr (tree, mem_function, *arguments):
>> """ if tree is not None then
Roy Smith <[EMAIL PROTECTED]> writes:
> ssecorp <[EMAIL PROTECTED]> wrote:
>
>> i dont get what you mean, if i dont do anything python will raise an
>> indexerror so it is an indexerror.
>
> You wrote:
>
>> > > def pop(self):
>> > > try:
>> > > return self.queue.pop(0)
>> >
Terry Reedy <[EMAIL PROTECTED]> writes:
> Bart Kastermans wrote:
>> I am playing with some trees. In one of the procedures I wrote
>> for this I am trying to change self to a different tree. A tree
>> here has four members (val/type/left/right). I found that self =
I am playing with some trees. In one of the procedures I wrote
for this I am trying to change self to a different tree. A tree
here has four members (val/type/left/right). I found that self = SS
does not work; I have to write self.val = SS.val and the same for
the other members (as shown below).
> | def __str__ (self):
>
> string appending is an O(n**2) operations. The usual idiom, applied here,
> would be slist = ['('], slist.append(str(self.value)), return
> ''.join(slist). In other words, collect list of pieces and join at end.
I did some timing of operations involved. Doing
On Jun 17, 1:01 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Mon, 16 Jun 2008 07:34:06 -0300, Bart Kastermans <[EMAIL PROTECTED]>
> escribió:
>
> > Summary: can't verify big O claim, how to properly time this?
>
> > This is in
Summary: can't verify big O claim, how to properly time this?
On Jun 15, 2:34 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Bart Kastermans" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> |I wrote a binary search tree in pytho
I wrote a binary search tree in python, explaining as I was doing it
how and why I did it. I am very interested in receiving comments on
the code, process, and anything else that will improve my coding or
writing.
I wrote this all up in my blog at:
http://kasterma.wordpress.com/2008/06/15/implem
Quick update on the below:
the issue has disappeared by itself. I did not get to working on this
much since sending my last message. Now that I am looking at this the
issue has disappeared.
On Jan 29, 8:23 pm, Bart Kastermans <[EMAIL PROTECTED]> wrote:
> I am trying to use imaplib w
On Jan 25, 5:05 am, [EMAIL PROTECTED] wrote:
> Hallo pyPeople,
>
> I wrote a little snippet of code that takes a list representing some
> 'digits', and according to a list of symbols, increments the digits through
> the symbol list.
>
> so for example,
>
> digits=["a","a","a"]
> symbols=["a","b","
I am trying to use imaplib with gmail. I am finding however that with
the gmail server imaplib.search does not give the correct answer. See
the below traces (k is a server a my department, i is gmail).
k has 6 messages in the INBOX
i has 3 messages in the INBOX
However i.search(None, "ALL")
only
The suggestion to use StringIO to make a string have the same
interface
as a file works perfect in my situation. Here is now the working
result
(just in case it is useful to anyone) part of this is still a definite
hack and suggestions for improvement are certainly appreciated.
Want:
have an easi
I have written a little program that takes as input a text file,
converts
it to a list with appropriate html coding (making it into a nice
table).
Finally I want to upload this list as a textfile using ftp.
If homeworkhtml contains the list of lines;
e.g. homeworkhtml = ["", "", "", "test", "" ...
23 matches
Mail list logo