[Tutor] Equivalent of Set in PtO

2011-04-26 Thread Becky Mcquilling
I have a code snippet that I have used to count the duplicates in a list as such: from sets import Set def countDups(duplicateList): uniqueSet = Set(item for item in duplicateList) return[(item, duplicateList.count(item)) for item in uniqueSet] lst = ['word', 'word', 'new', 'new', 'new'] pr

Re: [Tutor] Unbound Method Error

2011-04-26 Thread Peter Otten
Greg Nielsen wrote: > if crash: > for BlueCarSprite in crash: > redracersprites26.BlueCarSprite.collide(crash, playerCar) > for GreenCarSprite in crash: > redracersprites26.GreenCarSprite.collide(crash, playerCar) > for Tr

Re: [Tutor] after(), how do I use it?

2011-04-26 Thread Alan Gauld
"michael scott" wrote Now I understand what I misunderstood. Well he imported Tkinter as tk, so I thought if it belonged to Tkinter it would be tk.after(), but the after was attached to the app, so it was in actuality app.after() . app inherits from the tk class (taking with it all its metho

Re: [Tutor] Equivalent of Set in PtO

2011-04-26 Thread Alan Gauld
"Becky Mcquilling" wrote from sets import Set def countDups(duplicateList): uniqueSet = Set(item for item in duplicateList) return[(item, duplicateList.count(item)) for item in uniqueSet] Can be abbreviated to: def countDups(duplicateList): return [(item, duplicateList.count(item)) fo

Re: [Tutor] Equivalent of Set in PtO

2011-04-26 Thread Steven D'Aprano
Becky Mcquilling wrote: I have a code snippet that I have used to count the duplicates in a list as such: from sets import Set Since Python 2.4, you no longer need to import module "sets" (note plural) to get Set (note capital letter). You can just use the built-in name "set" (note lower-cas

Re: [Tutor] Equivalent of Set in PtO

2011-04-26 Thread Peter Otten
Becky Mcquilling wrote: > I have a code snippet that I have used to count the duplicates in a list > as such: > > from sets import Set > > def countDups(duplicateList): > uniqueSet = Set(item for item in duplicateList) > return[(item, duplicateList.count(item)) for item in uniqueSet] > > >

Re: [Tutor] voluntary work :p:

2011-04-26 Thread Edgar Almonte
you need solve the problem and so far the solution of the problem is the name of the next url example: .html , you need get the result and change in the url bar On Tue, Apr 26, 2011 at 12:19 AM, bob gailer wrote: > On 4/25/2011 11:59 PM, Wolf Halton wrote: >> >> I didn't get anything out of pytho

[Tutor] Deleting strings from a line

2011-04-26 Thread Spyros Charonis
Hello, I've written a script that scans a biological database and extracts some information. A sample of output from my script is as follows: LYLGILLSHAN AA3R_SHEEP26331 LYMGILLSHAN AA3R_HUMAN26431 MCLGILLSHANAA

Re: [Tutor] Deleting strings from a line

2011-04-26 Thread Martin A. Brown
Greetings, : I've written a script that scans a biological database and extracts some : information. A sample of output from my script is as follows: : : LYLGILLSHAN AA3R_SHEEP26331 : : LYMGILLSHAN AA3R_HUMAN26431 : : MCLGILLS

Re: [Tutor] Deleting strings from a line

2011-04-26 Thread Peter Otten
Spyros Charonis wrote: > Hello, > > I've written a script that scans a biological database and extracts some > information. A sample of output from my script is as follows: > > LYLGILLSHAN AA3R_SHEEP26331 > > LYMGILLSHAN AA3R_HUMAN26431

Re: [Tutor] Deleting strings from a line

2011-04-26 Thread Steven D'Aprano
Spyros Charonis wrote: Hello, I've written a script that scans a biological database and extracts some information. A sample of output from my script is as follows: LYLGILLSHAN AA3R_SHEEP26331 LYMGILLSHAN AA3R_HUMAN26431 MCLGILLSHAN

Re: [Tutor] voluntary work :p:

2011-04-26 Thread Walter Prins
On 26 April 2011 04:59, Wolf Halton wrote: > I didn't get anything out of pythonchallenge. All seems static. Do you > need flash or something to make the magic happen? > > To add to what the others have said and explain the "flow" a bit more: Each challenge is a puzzle, with hints present in v

[Tutor] Gtk - relational data display and edit

2011-04-26 Thread bodsda
Hi, I am reading in data from a csv file which will be in a format like this User1, attrib1, attrib2 User2, attrib1, attrib2 Etc. And need to display this in a window. My initial thought was to use gtk.Entry widgets because I will need to edit this data, but I don't think this will work as I w

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread Walter Prins
On 26 April 2011 16:34, wrote: > Hi, > > I am reading in data from a csv file which will be in a format like this > > User1, attrib1, attrib2 > User2, attrib1, attrib2 > Etc. > Why would the data be in this format? Are you defining it? Reason I ask is that, relationally speaking, (e.g. databas

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread Timo
On 26-04-11 17:34, bod...@googlemail.com wrote: Hi, I am reading in data from a csv file which will be in a format like this User1, attrib1, attrib2 User2, attrib1, attrib2 Etc. And need to display this in a window. My initial thought was to use gtk.Entry widgets because I will need to edit t

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread Knacktus
Am 26.04.2011 17:34, schrieb bod...@googlemail.com: Hi, I am reading in data from a csv file which will be in a format like this User1, attrib1, attrib2 User2, attrib1, attrib2 Etc. And need to display this in a window. My initial thought was to use gtk.Entry widgets because I will need to ed

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread bodsda
Thanks for your reply. Unfortunately I can't change the data format because it is output from a closed source app. I can't figure out a way to create the entry widgets on the fly because they need to be bound to a variable to attach them to a gtk.Table and to be able to read the data from them