Re: [Tutor] class to function

2014-05-25 Thread Danny Yoo
> i am trying to understand this code: > http://nbviewer.ipython.org/gist/BenLangmead/6665861 I'm slightly familiar with the purpose of the code. It's constructing a Suffix Tree, though not in linear time. Reading the code... ah. I see. This is enumerating through all suffixes, and building it

Re: [Tutor] what is the cores?

2014-05-25 Thread Marino David
Thanks Marc. After I have close look at the toolbox, I found that cores.py is in the toolbox. Thanks again. David 2014-05-26 2:21 GMT+08:00 Marc Tompkins : > On Sun, May 25, 2014 at 10:32 AM, Marino David > wrote: > > Hi all: > > I am a newpie at python. > > I read a python toolbox in which t

Re: [Tutor] what is the cores?

2014-05-25 Thread Marc Tompkins
On Sun, May 25, 2014 at 10:32 AM, Marino David wrote: > Hi all: > I am a newpie at python. > I read a python toolbox in which there is code line:import cores as co. I > wantta know what the cores is. > When I type "import cores as co", error occur as follows: > Traceback (most recent call last): >

[Tutor] what is the cores?

2014-05-25 Thread Marino David
Hi all: I am a newpie at python. I read a python toolbox in which there is code line:*import cores as co. *I wantta know what the cores is. When I type "*import cores as co*", error occur as follows: *Traceback (most recent call last):* * File "", line 1, in * *ImportError: No module named cores*

Re: [Tutor] Pygame related question

2014-05-25 Thread Peter Otten
diliup gabadamudalige wrote: > I need to random pick a pygame sprite from a sprite class. > The random module does not allow this to be used on a group. > Is the shortest way to raed in the attributes thatr I need into a list and > then random pick that or is there a shorter way? Sample code is gi

Re: [Tutor] class to function

2014-05-25 Thread Alan Gauld
On 25/05/14 16:39, rahmad akbar wrote: Hi guys i am trying to understand this code: http://nbviewer.ipython.org/gist/BenLangmead/6665861 i understand functions quite alright . but i have no idea about classes yet. Do you understand modules? Modules contain functions and data that you can reus

Re: [Tutor] class to function

2014-05-25 Thread Alex Kleider
On 2014-05-25 09:20, R. Alan Monroe wrote: can you guys help explain. super thanks A class is like a blueprint. An instance of that class is like a house built from that blueprint. Think about it. An infinite number of houses could be constructed using those blueprints. But the architect only

Re: [Tutor] class to function

2014-05-25 Thread R. Alan Monroe
> can you > guys help explain. super thanks A class is like a blueprint. An instance of that class is like a house built from that blueprint. Think about it. An infinite number of houses could be constructed using those blueprints. But the architect only had to draw them once. __init__() is like

[Tutor] class to function

2014-05-25 Thread rahmad akbar
Hi guys i am trying to understand this code: http://nbviewer.ipython.org/gist/BenLangmead/6665861 i understand functions quite alright . but i have no idea about classes yet. the code is written using class and i could not make much sense out of it. all this init and self thingy drive me crazy. c

Re: [Tutor] Pygame related question

2014-05-25 Thread Dave Angel
Steven D'Aprano Wrote in message: > On Sun, May 25, 2014 at 12:48:40PM +0530, diliup gabadamudalige wrote: >> I need to random pick a pygame sprite from a sprite class. >> The random module does not allow this to be used on a group. >> Is the shortest way to raed in the attributes thatr I need int

Re: [Tutor] Pygame related question

2014-05-25 Thread Steven D'Aprano
On Sun, May 25, 2014 at 12:48:40PM +0530, diliup gabadamudalige wrote: > I need to random pick a pygame sprite from a sprite class. > The random module does not allow this to be used on a group. > Is the shortest way to raed in the attributes thatr I need into a list and > then random pick that or

[Tutor] Pygame related question

2014-05-25 Thread diliup gabadamudalige
I need to random pick a pygame sprite from a sprite class. The random module does not allow this to be used on a group. Is the shortest way to raed in the attributes thatr I need into a list and then random pick that or is there a shorter way? Sample code is given below. sc