Re: searching a value of a dict (each value is a list)

2007-12-09 Thread Zepo Len
> I have a dictionary with million keys. Each value in the > dictionary has a list with up to thousand integers. > Follow is a simple example with 5 keys. > > dict = {1: [1, 2, 3, 4, 5], >2: [10, 11, 12], >90: [100, 101, 102, 103, 104, 105], >91: [20, 21, 22], >99: [15,

Re: highscores list

2007-12-08 Thread Zepo Len
> I'm writing a game that uses two functions to check and see if a file > called highScoresList.txt exists in the main dir of the game program. > If it doesn, it creates one. That part is working fine. The problem is > arising when it goes to read in the high scores from the file when I

Re: read lines

2007-12-04 Thread Zepo Len
> Your regex is not working correctly I guess, I don't even know why you > are using a regex, something like this would work just fine: > > import sys > nums = [float(line.split(' -')[1]) for line in open(sys.argv[1])] > print 'min=', min(nums), 'max=', max(nums) Sorry, that should be line.split

Re: read lines

2007-12-04 Thread Zepo Len
> Hi, I have a text file like this; > > 1 -33.453579 > 2 -148.487125 > > > So I want to write a program in python that reads each line and > detects which numbers of the second column are the maximum and the > minimum. > > I tried with; > > import os, sys,re,string > > # first parameter is the

Re: Pulling data from a .asps site

2007-11-27 Thread Zepo Len
On Tue, 27 Nov 2007 20:37:19 +0200, <[EMAIL PROTECTED]> wrote: > > There's a government website which shows public data for banks. We'd > like to pull the data down programmatically but the data is "hidden" > behind .aspx... > > Is there anyway in Python to hook in directly to a browser (firefox o