Re: [Tutor] Limitation of range() function in Walking problem

2006-09-16 Thread Alan Gauld
> I loop through each list and check if list[0] is in > range of previous list list[1] AND if it is less or > greater than. If less, I retain the greater number and > loop through. ... > example are small, it worked. in the real world > example , it did not work, because computer slowed > down and

Re: [Tutor] Limitation of range() function in Walking problem

2006-09-16 Thread Andrei
Srinivas Iyyer wrote: > Coordinates of a variable G1: > a1 : 3-8 > b2 : 10-25 > c3 : 7-18 > d4 : 10-13 > Now, I have variables G1Gn. Each variable may > have individual pieces a1(n),b2(n),c3(n).z(n). > > my kind of solution, which is very crappy (i assume): > > Sort the list: > [3,8]

[Tutor] Lists in lists

2006-09-16 Thread Morten Juhl Johansen
# Newbie warning I am making a timeline program. It is fairly simple. I base it on appending lists to a list. Ex. [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] This seemed like a brilliant idea when I did it. It is easy to sort. Now, if I want to OUTPUT it, how do I in

Re: [Tutor] Lists in lists

2006-09-16 Thread Andrei
Morten Juhl Johansen wrote: > # Newbie warning > I am making a timeline program. It is fairly simple. > I base it on appending lists to a list. > Ex. > [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] > > This seemed like a brilliant idea when I did it. It is easy to sort

[Tutor] ANN: pyfuzzylib 0.1.3 Released

2006-09-16 Thread nelson -
PyFuzzyLib is a library for fuzzy inference engine building. Using pyfuzzylib you can add fuzzy logic to your programs. The program is in it early stage of development, but it is still usable. Every sort of feedback is appreciated! the project homepage is http://sourceforge.net/projects/pyfuzzyli

[Tutor] Data structure question / PyGoogle

2006-09-16 Thread Brian Edward
Hello all,I am new to Python (and programming in general) and am trying to get PyGoogle figured out for some specific research interests.  Basically, I have done a simple search using PyGoogle and have some sitting in memory.  I have an object data.results, which is apparently a list:>>> type(data

Re: [Tutor] Data structure question / PyGoogle

2006-09-16 Thread Alan Gauld
> In this list, I have ten URL saved, which I can access by using the > brackets > and noting the specific elements. For example: > data.results[0].URL > 'http://www.psychguides.com/gl-treatment_of_schizophrenia_1999.html' > My question is, how can I access all ten URLs in a single command.

Re: [Tutor] Data structure question / PyGoogle

2006-09-16 Thread Python
On Sat, 2006-09-16 at 09:44 -0500, Brian Edward wrote: > Hello all, > > I am new to Python (and programming in general) and am trying to get > PyGoogle figured out for some specific research interests. Basically, > I have done a simple search using PyGoogle and have some sitting in > memory. I h

[Tutor] From byte[] to Image

2006-09-16 Thread Ziad Rahhal
Hi, I convert an Image to bye array in Java (web-services) and send it to a python client. At the client side (python code) i receive the bytes, and then i need to transform them into the image again. Here is what I am doing: #** # fil

Re: [Tutor] Data structure question / PyGoogle

2006-09-16 Thread Python
(forwarding to list) On Sat, 2006-09-16 at 10:31 -0500, Brian Edward wrote: > Thanks for the quick reply! I really appreciate your assistance. Of > course, it will take some time to get this worked out, but your > explanation is very clear. > > Best, > Brian > > > On 9/16/06, Python <[EMAI

Re: [Tutor] Problems serving up PDF

2006-09-16 Thread Tim Johnson
* Python <[EMAIL PROTECTED]> [060915 04:35]: > > There is a Firefox extension called TamperData that allows you to > examine and change the headers. This extension is very handy for > debugging these kinds of issues. My Apache web server returns these > headers when I request a pdf file: > > St

Re: [Tutor] Lists in lists

2006-09-16 Thread Brian van den Broek
Morten Juhl Johansen said unto the world upon 16/09/06 08:29 AM: > # Newbie warning > I am making a timeline program. It is fairly simple. > I base it on appending lists to a list. > Ex. > [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] > > This seemed like a brilliant i

Re: [Tutor] From byte[] to Image

2006-09-16 Thread Alan Gauld
Hi Ziad, Can you give us a bit mor4e detail. > #** > # fileName is the path of the file > stream = service.getFile(fileName) > > file = open("pic.jpeg", 'w') > > img = Image.frombuffer("1", (128, 128), stream) > img.save(file) Which l

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Morten Juhl Johansen wrote: > # Newbie warning > I am making a timeline program. It is fairly simple. > I base it on appending lists to a list. > Ex. > [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] > > This seemed like a brilliant idea when I did it. It is easy to sort

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Brian van den Broek wrote: > Morten Juhl Johansen said unto the world upon 16/09/06 08:29 AM: >> # Newbie warning >> I am making a timeline program. It is fairly simple. >> I base it on appending lists to a list. >> Ex. >> [[year1, "headline1", "event text1"], [year2, "headline2", "event text2"]] >

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Kent Johnson wrote: > It's handy to assign names to the individual elements of the list. A > variable named 'year' is a lot easier to understand than 'event[0]'. > This is easy to do with tuple unpacking: > > In [6]: for event in events: > ...: year, head, text = event > ...: pri

Re: [Tutor] Lists in lists

2006-09-16 Thread Brian van den Broek
Kent Johnson said unto the world upon 16/09/06 04:35 PM: > Brian van den Broek wrote: >> Morten Juhl Johansen said unto the world upon 16/09/06 08:29 AM: >>> # Newbie warning >>> I am making a timeline program. It is fairly simple. >>> I base it on appending lists to a list. >>> Ex. >>> [[year1, "h

Re: [Tutor] Lists in lists

2006-09-16 Thread PythonIn.dk
Thank you for your tips on my list list. I see how there are advantages to the different approaches. I expect to simply output the text and pipe it somewhere else - so, it is not actually an issue to access the individual posts. Yours, (probably back later) Morten _

Re: [Tutor] Lists in lists

2006-09-16 Thread Kent Johnson
Brian van den Broek wrote: > Kent Johnson said unto the world upon 16/09/06 04:35 PM: >> Brian van den Broek wrote: >>> You say you are new to Python. Well, it might not now be obvious why >>> dictionaries are especially useful, but they are *central* to the >>> pythonic approach. The sooner you

[Tutor] folder and module

2006-09-16 Thread linda.s
Hi there, i have test.py under c:\try1\new; I want to import b and b.py is under c:\trytry. How to do it? Also, I import c and c.py is in the desktop folder but no error reported. Why? Thanks, Linda On 9/2/06, linda. s <[EMAIL PROTECTED]> wrote: > I read something about random.seed() but still c

[Tutor] Cookie help

2006-09-16 Thread federico ramirez
Hey, im working on a cgi script, just a simple news system.And im stucked with the login system.GOD! I hate being a noob!Well, this is the login page#!/usr/bin/python import cgi, dbm, string, Cookieimport configrequest = cgi.FieldStorage()def loginform():    print ''

[Tutor] Problems with Python Modules

2006-09-16 Thread Will Shattuck
Hi all, I'm trying to install some python mud engines, but I keep running into problems with the software not seeing python modules. Could this be due to environment variables missing on my system? Here is an example of the most recent error message using the InnerSpace mud engine:

Re: [Tutor] Problems with Python Modules

2006-09-16 Thread Dave Kuhlman
On Sat, Sep 16, 2006 at 08:10:21PM -0700, Will Shattuck wrote: > Hi all, > > I'm trying to install some python mud engines, but I keep running into > problems with the software not seeing python modules. Could this be > due to environment variables missing on my system? Here is an example > of t