Re: Merging Objects

2006-04-03 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >>> help(getattr) help(setattr) Regards, Jesus Rivero - (Neurogeek) Cloudthunder wrote: > Question: how do I merge two objects? I would like to be able to > have an instance of Foo and an instance of Boo and then be able to >

Threads and sys.excepthook

2006-03-28 Thread Jesus Rivero - (Neurogeek)
Hello guys, I have this problem and i don't know any workarounds yet. Im implementing a DB Connection pool, which initially creates 20 connections and keep them in a dictionary. It also implements a method for allowing external method/classes to get a connection from that pool. he main issue is

Re: Where does Python look for libraries?

2006-03-27 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Python has sys.path If you want to add dirs into your PYTHONPATH add them to sys.path Jesus Rivero - (Neurogeek) ACB wrote: > I have been trying to get the gdmodule installed and have run into > an issue. When I import gd I get the following

Re: pydoc does not like this file

2006-03-23 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hmmm guess -w should be after python and not after pydoc: python -w c:\python24\Lib\pydoc.py .\setup.py And i also guess you are missing a command after setup.py (if you are using py2exe, that must be the command you are looking for.) so try this:

Re: nested for loops

2006-03-21 Thread Jesus Rivero - (Neurogeek)
It is, but range(2,2) doesn't do anything Jesus Rivero - Neurogeek John Salerno wrote: >Can someone tell me why 'n' in this example isn't 2? > > >>> for n in range(2, 10): > for x in range(2, n): > print 'x =', x, &#

Re: algorithm, optimization, or other problem?

2006-02-21 Thread Jesus Rivero (Neurogeek)
Hello, If the parameters that are received by functions in order to calculate weights, th's and dot's products , are equal to each other in different cycles (and i bet more than often they will) i suggest you replace those functions with memoizable functions. That also would ease work inside the l

Re: html parser , unexpected '<' char in declaration

2006-02-21 Thread Jesus Rivero (Neurogeek)
Oopss! You are totally right guys, i did miss the closing '>' thinking about maybe errors in the use of ' or ". Jesus Tim Roberts wrote: >"Jesus Rivero - (Neurogeek)" <[EMAIL PROTECTED]> wrote: > > >>hmmm, that's kind of differ

Re: html parser , unexpected '<' char in declaration

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hmmm, that's kind of different issue then. I can guess, from the error you pasted earlier, that the problem shown is due to the fact Python is interpreting a "<" as an expression and not as a char. review your code or try to figure out the exact input

Re: html parser , unexpected '<' char in declaration

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sakcee wrote: > html = > ' \r\n Foo foo , blah blah > ' > > html = """ Foo foo , blah blah """ Try checking your html code. It looks really messy. '

Re: how to break a for loop?

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Gregory! I would also use lists to implement this. They are more practical and you could take advantage of pop() or remove() methods instead of using the Oh-so-Scary del. You could also use a lambda+map or reduce methods to remove all ze

Re: [Python-Dev] (-1)**(1/2)==1?

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello! it's Ok. Python gets from 1/2 0 as 0 is the integer part of that division. So, Python is interpreting -1**0 so you get 1 as answer. you should try this (-1)**(1.0/2.0) so 1.0/2.0 is an operation returning 0.5 completely. and you'll get: