max baseman wrote:
> right it's for a quick math "game" the rules are simple you start
> with any number to get the next number you, a. if it's odd multiply
> by 3 than add 1 or b. if it's even divide by two, the point of this
> is to see how long it takes to get to one are it starts to repe
cool thank you :)
On Aug 29, 2007, at 11:02 PM, Luke Paireepinart wrote:
> max baseman wrote:
>> right it's for a quick math "game" the rules are simple you start
>> with any number to get the next number you, a. if it's odd
>> multiply by 3 than add 1 or b. if it's even divide by two, th
thats what it does but in order to just be able to let it sit and
work for as long as it can i made it a endless loop of just trying
every number, for now it just displays the highest on the screen but
it would be nice to get it in a text document
thanks
On Aug 30, 2007, at 4:53 AM, Kent Jo
Dear All,
I have written a Delaunay triangulation 10 years ago
in C based on triangle structure.
It was 400 lines, so it seems to be a fine task to turn into python.
My problem is the translation of the C structure and the OO thinking.
I tried to draft it so.
/*
The triangle, its neighbours,
"János Juhász" <[EMAIL PROTECTED]> wrote
> ## I can translate it into python in this way
> class Triangle:
>def __init__(self, points, neighbours):
>self.points = points
>self.neighbours = neighbours
>
> def TOR(self, direction):
>return (self, (direction+1)%3)
>
Terry Carroll wrote:
> On Wed, 29 Aug 2007, Scott Oertel wrote:
>
>
>> Why even have the keys variable at all..
>>
>> for key in attrs:
>> print 'Attribute %s has value %s' % (key, attrs[key])
>>
>
> In a prior email thread, the OP indicated that he needed to process the
> keys in that
Someone asked me this question the other day, and I couldn't think of
any easy way of printing the output besides what I came up with pasted
below.
So what you have is a file with words in it as such:
apple
john
bean
joke
ample
python
nice
and you want to sort and output the text into columns as
Dear Allan,
thanks for your coments.
> > ## I can translate it into python in this way
> > class Triangle:
> >def __init__(self, points, neighbours):
> >self.points = points
> >self.neighbours = neighbours
> >
> > def TOR(self, direction):
> >return (self, (direct
"Scott Oertel" <[EMAIL PROTECTED]> wrote
> and you want to sort and output the text into columns as such:
>
> a p j b n
> apple python john bean nice
> ample joke
>
> and this is what works, but I would
Alan Gauld wrote:
> "Scott Oertel" <[EMAIL PROTECTED]> wrote
>
>
>> and you want to sort and output the text into columns as such:
>>
>> a p j b n
>> apple python john bean nice
>> ample joke
>>
>> and
Scott Oertel wrote:
> #!/usr/bin/env python
>
> data = {}
> lrgColumn = 0
>
> for line in open("test.txt","r").read().splitlines():
> char = line[0].lower()
> if not char in data:
> data[char] = [line]
> else:
> data[char].append(line)
I like
data.setdefault(char,
"János Juhász" <[EMAIL PROTECTED]> wrote
>> > ## I can translate it into python in this way
>> > class Triangle:
>> > def __init__(self, points, neighbours):
>> > def TOR(self, direction):
>> > def ROT(self, direction):
>> > def RIGHT(self, direction):
>> and store it as an attrib
"Scott Oertel" <[EMAIL PROTECTED]> wrote
>> Use format strings. You can calculate the column widths by
>> analyzing
>> the data then create a format string for the required number of
>> columns.
>> Finally insert the data on each row from a tuple.
>>
> Do you have any good documentation that cou
I'm trying to follow the example listed in the wiki at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject regarding the
use of a metaclass.
What I don't understand is how the metaclass (EntitySingleton) has access to
the variable ctx which is instantinated outside the scope of the cla
Alan Gauld wrote:
> "Scott Oertel" <[EMAIL PROTECTED]> wrote
>> Do you have any good documentation that could shed some more light
>> on
>> exactly how to use format strings in such a way?
>
> The docs contain the basic documentation
http://docs.python.org/lib/typesseq-strings.html
> # there's
Orest Kozyar wrote:
> I'm trying to follow the example listed in the wiki at
> http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject regarding the
> use of a metaclass.
>
> What I don't understand is how the metaclass (EntitySingleton) has access to
> the variable ctx which is instantina
On Thu, Aug 30, 2007 at 06:02:12PM -0400, Orest Kozyar wrote:
> I'm trying to follow the example listed in the wiki at
> http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject regarding the
> use of a metaclass.
>
> What I don't understand is how the metaclass (EntitySingleton) has access
Dave Kuhlman wrote:
> So far so good. But, here is the one I do not understand.
>
> G1 = 111
> class A(object):
> G1 = 222
> def show(self):
> print G1
>
> def test():
> a = A()
> a.show()
>
> test()
>
> But, when I run this I see "11
"Dave Kuhlman" <[EMAIL PROTECTED]> wrote
> Actually, the particular edition of Alan's book that I have is old
> enough so that it does not discuss the Enclosing namespace, which
> came later to Python. The enclosing namespace not make a
> difference in your example, but does in mine.
The paper
Scott Oertel wrote:
> Someone asked me this question the other day, and I couldn't think of
> any easy way of printing the output besides what I came up with pasted
> below.
>
> So what you have is a file with words in it as such:
>
> apple
> john
> bean
> joke
> ample
> python
> nice
>
> and you w
20 matches
Mail list logo