Cheap Wholesale Adidas Shoes (paypal payment)

2010-04-17 Thread world-trade
Cheap Wholesale UGG Shoes (paypal payment) (http://www.jordanonline06.com/) Cheap Wholesale Ugg Boots (paypal payment) Cheap Wholesale Gucci Shoes (paypal payment) (http://www.jordanonline06.com/) Cheap Wholesale GUCCI Boots Cheap Wholesale Lacoste Shoes Cheap Wholesale LV S

Python at BerkeleyTIP-Global meeting on Sunday April 18 12N-3P, & April 27

2010-04-17 Thread giovanni_re
Come discuss python. :) Join via VOIP or come to Berkeley http://sites.google.com/site/berkeleytip/voice-voip-conferencing FSCafe at Moffitt at UCBerkeley, opens 1pm, but can connect from outside at 12N. Hot topics: Ubuntu 10.04, Free Culuture, VOIP, Set up the web server & mail list & asterisk/f

Re: Python 2.7b1 and argparse's version action

2010-04-17 Thread Tobias Herp
Am 18.04.2010 04:09, schrieb Chris Rebert: > On Sat, Apr 17, 2010 at 6:53 PM, Tobias Herp > wrote: >> Hi, all, >> >> I notice that Python 2.7 beta 1 now contains the argparse module, which >> might be a good thing. The code has been cleaned up, too. >> >> But there is still one issue with argpars

Re: Python 2.7b1 and argparse's version action

2010-04-17 Thread Chris Rebert
On Sat, Apr 17, 2010 at 6:53 PM, Tobias Herp wrote: > Hi, all, > > I notice that Python 2.7 beta 1 now contains the argparse module, which > might be a good thing.  The code has been cleaned up, too. > > But there is still one issue with argparse: > Completely unnecessarily, the 'version' construc

Python 2.7b1 and argparse's version action

2010-04-17 Thread Tobias Herp
Hi, all, I notice that Python 2.7 beta 1 now contains the argparse module, which might be a good thing. The code has been cleaned up, too. But there is still one issue with argparse: Completely unnecessarily, the 'version' constructor argument is now deprecated. This fact doesn't solve any prob

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Steven D'Aprano
On Sat, 17 Apr 2010 17:23:45 +0200, Alain Ketterlin wrote: > Steven D'Aprano writes: > >> On Sat, 17 Apr 2010 12:05:03 +0200, Alain Ketterlin wrote: >> I don't know of any language that creates a new scope for loop variables, but perhaps that's just my ignorance... >>> >>> I think Pas

Re: Nested list problem - please...

2010-04-17 Thread Chris Rebert
On Sat, Apr 17, 2010 at 12:40 PM, Martin Hvidberg wrote: > I have this code, it builds up a data structure of nested lists, and filling > data in them. > My problem is that it seems that one of the lists SA[1] is not a list of > unique instances but rather individual links to the same variable.

Nested list problem - please...

2010-04-17 Thread Martin Hvidberg
Dear list I have this code, it builds up a data structure of nested lists, and filling data in them. My problem is that it seems that one of the lists SA[1] is not a list of unique instances but rather individual links to the same variable. In the example below I assign 'X' to what I intended to

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Ethan Furman
There's no RightAnswer(tm), just our best guess as to what is the most useful behavior for the most number of people. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Usable street address parser in Python?

2010-04-17 Thread John Nagle
Is there a usable street address parser available? There are some bad ones out there, but nothing good that I've found other than commercial products with large databases. I don't need 100% accuracy, but I'd like to be able to extract street name and street number for at least 98% of US mailin

Re: My first project

2010-04-17 Thread Someone Something
no one cares? :( On Sat, Apr 17, 2010 at 8:41 AM, Someone Something wrote: > This is my first large-scale (sort of) project in python. It is still under > daily development, but the core is pretty stable (although, I'm still adding > features). Here's the code: http://github.com/Poincare/PyEventL

Re: Python Learning Environment

2010-04-17 Thread Vijay Shanker Dubey
Thanks friend, Got the point. Regards, Vijay Shanker Dubey On Sat, Apr 17, 2010 at 11:31 PM, Krister Svanlund < krister.svanl...@gmail.com> wrote: > On Sat, Apr 17, 2010 at 7:06 PM, Vijay Shanker Dubey > wrote: > > Yes you are right about symlink thing. > > So what should I do for a clever

Re: Python Learning Environment

2010-04-17 Thread Krister Svanlund
On Sat, Apr 17, 2010 at 7:06 PM, Vijay Shanker Dubey wrote: > Yes you are right about symlink thing. > So what should I do for a clever developer environment? > Should I change that python link to python3 or python3.1? > > Regards, > Vijay Shanker Dubey > It all depends on what you want to do. I

Re: An open source AI research project

2010-04-17 Thread Someone Something
I would like to know more please. Does it have a website? On Sat, Apr 17, 2010 at 4:03 AM, David Zhang wrote: > Hello! > > I have started an open source project to develop human-level > Artificial Intelligence, using Python and Java as programming > language, OpenCog and OpenWonderland as basemen

Re: Python Learning Environment

2010-04-17 Thread Krister Svanlund
On Sat, Apr 17, 2010 at 6:32 PM, Vijay Shanker Dubey wrote: > Hi, > My Linux box is ubuntu system. I want to create a development environment on > my system for python programing language. I got to see there are two > versions of python language > 1. python 2.5.6 > 2. python 3.1.2 > To find out wh

Python Learning Environment

2010-04-17 Thread Vijay Shanker Dubey
Hi, My Linux box is ubuntu system. I want to create a development environment on my system for python programing language. I got to see there are two versions of python language 1. python 2.5.6 2. python 3.1.2 To find out what version i look in to my "/usr/bin" folder. There are many entries for

Re: getting a string as the return value from a system command

2010-04-17 Thread Robert Kern
On 2010-04-17 01:49 , CHEN Guang wrote: > Catherine Moroney wrote: >> Hello, >> >> I want to call a system command (such as uname) that returns a string, >> and then store that output in a string variable in my python program. >> >> What is the recommended/most-concise way of doing this?

Re: extract substring by regex from a text file

2010-04-17 Thread Alessio
On Apr 17, 11:05 am, Peter Otten <__pete...@web.de> wrote: > > Just in case you didn't know: > >     for line in instream: >         ... > > looks better, uses less memory, and may be a tad faster than > >     for line in instream.readlines(): >         ... > > Peter Thanks for your suggestions, t

Re: class instance customization

2010-04-17 Thread Alexander
On 17.04.2010 18:32, Steven D'Aprano wrote: > On Sat, 17 Apr 2010 13:09:43 +0400, Alexander wrote: > > >> Hi, list. >> >> I've some nontrivial class implementation MyClass and its instance my: >> >> my = MyClass(args) >> >> MyClass uses in internals some variable which is not defined in MyClass

Re: How to run program in Linux

2010-04-17 Thread Jim Byrnes
Dave Angel wrote: Jim Byrnes wrote: Dave Angel wrote: Jim Byrnes wrote: Dave Angel wrote: Jim Byrnes wrote: I am just learning Python and am new to Linux so I am probably doing something to trip myself up. I am trying to run an example GUI program that fetches a record from a database. All t

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Alain Ketterlin
Steven D'Aprano writes: > On Sat, 17 Apr 2010 12:05:03 +0200, Alain Ketterlin wrote: > >>> I don't know of any language that creates a new scope for loop >>> variables, but perhaps that's just my ignorance... >> >> I think Pascal and Modula-2 do this, Fortran does this, as well as Ada. > > Pasca

Re: How to run program in Linux

2010-04-17 Thread Dave Angel
Jim Byrnes wrote: Dave Angel wrote: Jim Byrnes wrote: Dave Angel wrote: Jim Byrnes wrote: I am just learning Python and am new to Linux so I am probably doing something to trip myself up. I am trying to run an example GUI program that fetches a record from a database. All the files are in th

Re: class instance customization

2010-04-17 Thread Steven D'Aprano
On Sat, 17 Apr 2010 13:09:43 +0400, Alexander wrote: > Hi, list. > > I've some nontrivial class implementation MyClass and its instance my: > > my = MyClass(args) > > MyClass uses in internals some variable which is not defined in MyClass > itself. I want to extend instance of MyClass at runtim

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Steven D'Aprano
On Sat, 17 Apr 2010 12:05:03 +0200, Alain Ketterlin wrote: >> I don't know of any language that creates a new scope for loop >> variables, but perhaps that's just my ignorance... > > I think Pascal and Modula-2 do this, Fortran does this, as well as Ada. Pascal doesn't do this. [st...@sylar pas

Re: Calling a class method

2010-04-17 Thread Walter Brameld IV
vsoler wrote: I have the following script: class TTT(object): def duplica(self): self.data *= 2 def __init__(self, data): self.data = data TTT.duplica(self.data) def __str__(self): return str(self.data) print obj=TTT(7) print obj And I want 14 printe

Re: An open source AI research project

2010-04-17 Thread Lie Ryan
On 04/18/10 00:13, Simon Brunning wrote: > On 17 April 2010 09:03, David Zhang wrote: >> I have started an open source project to develop human-level >> Artificial Intelligence... > > Have you people never seen Terminator? Sheesh. Ssshhh, you're disclosing our top-secret plan... -- http://mail.

Re: Calling a class method

2010-04-17 Thread Walter Brameld IV
vsoler wrote: I have the following script: class TTT(object): def duplica(self): self.data *= 2 def __init__(self, data): self.data = data TTT.duplica(self.data) def __str__(self): return str(self.data) print obj=TTT(7) print obj And I want 14 printe

Re: Calling a class method

2010-04-17 Thread Steven D'Aprano
On Sat, 17 Apr 2010 15:44:56 +0200, Andreas Waldenburger wrote: > On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler > wrote: > >> I got the following error: >> TypeError: unbound method duplica() must be called with TTT instance as >> first argument (got int instance instead) >> >> What am I doin

Re: An open source AI research project

2010-04-17 Thread Simon Brunning
On 17 April 2010 09:03, David Zhang wrote: > I have started an open source project to develop human-level > Artificial Intelligence... Have you people never seen Terminator? Sheesh. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a class method

2010-04-17 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 15:44:56 +0200 Andreas Waldenburger wrote: > On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler > wrote: > > > I got the following error: > > TypeError: unbound method duplica() must be called with TTT instance > > as first argument (got int instance instead) > > > > What am I

Re: Calling a class method

2010-04-17 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler wrote: > [snip actual question] Oh and a note on vocabulary: A "class method" is a somewhat advanced topic and quite probably not what you want here. They are not used very often. What I proposed in the other post was an "instance method", which i

Re: How to run program in Linux

2010-04-17 Thread Jim Byrnes
Dave Angel wrote: Jim Byrnes wrote: Dave Angel wrote: Jim Byrnes wrote: I am just learning Python and am new to Linux so I am probably doing something to trip myself up. I am trying to run an example GUI program that fetches a record from a database. All the files are in the same folder. The

Re: Calling a class method

2010-04-17 Thread Andreas Waldenburger
On Sat, 17 Apr 2010 06:09:21 -0700 (PDT) vsoler wrote: > I got the following error: > TypeError: unbound method duplica() must be called with TTT instance > as first argument (got int instance instead) > > What am I doing wrong? Not reading the error message. You need to create a TTT instance

Can someone please make it more pythonic or better?

2010-04-17 Thread Oltmans
Greetings Python superstars, I've a directory structure like following tests / __init__.py testfile.py testfile.py contains following code import unittest class Calculator(unittest.TestCase): def test_add(self): print 'just add' def test_divide(self): pr

Re: Calling a class method

2010-04-17 Thread Xavier Ho
On Sat, Apr 17, 2010 at 11:09 PM, vsoler wrote: > I have the following script: > > class TTT(object): >def duplica(self): >self.data *= 2 >def __init__(self, data): >self.data = data >TTT.duplica(self.data) > You're calling duplica with the class, and not by its o

Calling a class method

2010-04-17 Thread vsoler
I have the following script: class TTT(object): def duplica(self): self.data *= 2 def __init__(self, data): self.data = data TTT.duplica(self.data) def __str__(self): return str(self.data) print obj=TTT(7) print obj And I want 14 printed (twice 7) I g

Re: cross-platform coloured text in terminal

2010-04-17 Thread Someone Something
That sounds like a nice idea, try it out and see what you make of it. (It may have been done before but probably not as a standalone module as it doesn't require that much code) On Sat, Apr 17, 2010 at 6:52 AM, Jonathan Hartley wrote: > On Apr 16, 5:59 pm, Lie Ryan wrote: > > On 04/16/10 19:28,

My first project

2010-04-17 Thread Someone Something
This is my first large-scale (sort of) project in python. It is still under daily development, but the core is pretty stable (although, I'm still adding features). Here's the code: http://github.com/Poincare/PyEventLoop or http://code.google.com/p/pyeventloop/ Tell me what you guys think of it (I'l

Re: when should I explicitly close a file?

2010-04-17 Thread Lie Ryan
On 04/17/10 21:23, Lawrence D'Oliveiro wrote: > In message > , gelonida > wrote: > >> I've been told, that following code snippet is not good. >> >> open("myfile","w").write(astring) ... > > I do that for reads, but never for writes. > > For writes, you want to give a chance for write errors t

Re: Striving for PEP-8 compliance

2010-04-17 Thread Lie Ryan
On 04/17/10 16:20, Gregory Ewing wrote: > Steven D'Aprano wrote: >> On Wed, 14 Apr 2010 22:10:28 +0200, Hans Mulder wrote: >> >> Anybody who invents another brace-delimited language should be beaten. You always end up with a big problem trying to make sure the braces are consistent w

Re: when should I explicitly close a file?

2010-04-17 Thread Lawrence D'Oliveiro
In message , gelonida wrote: > I've been told, that following code snippet is not good. > > open("myfile","w").write(astring) ... I do that for reads, but never for writes. For writes, you want to give a chance for write errors to raise an exception and alert the user, instead of failing sil

Re: Creating a standalone application

2010-04-17 Thread Lawrence D'Oliveiro
In message <4bc4ec17.3040...@4c.ucc.ie>, Luis Quesada wrote: > Lawrence D'Oliveiro wrote: > >> In message , Luis Quesada wrote: >> >>> I am getting an "expected string without null bytes" error when using >>> cxfreeze for creating a standalone application (in Linux-Ubuntu). >> >> Why bother? Eve

Re: Creating a standalone application

2010-04-17 Thread Lawrence D'Oliveiro
In message , Jonathan Hartley wrote: > On Apr 13, 10:42�pm, Lawrence D'Oliveiro > wrote: > >> In message , Luis Quesada wrote: >> >> > I am getting an "expected string without null bytes" error when using >> > cxfreeze for creating a standalone application (in Linux-Ubuntu). >> >> Why bother? Eve

Re: cross-platform coloured text in terminal

2010-04-17 Thread Jonathan Hartley
On Apr 16, 5:59 pm, Lie Ryan wrote: > On 04/16/10 19:28, Jonathan Hartley wrote: > > > I'm playing with ideas of what API to expose. My favourite one is to > > simply embed ANSI codes in the stream to be printed. Then this will > > work as-is on Mac and *nix. To make it work on Windows, printing c

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Alain Ketterlin
Steven D'Aprano writes: > On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: > >>>Nevertheless, it is a common intuition that the list comp variable >>>should *not* be exposed outside of the list comp, and that the for-loop >>>variable should. Perhaps it makes no sense, but it is very common -- >>>I

class instance customization

2010-04-17 Thread Alexander
Hi, list. I've some nontrivial class implementation MyClass and its instance my: my = MyClass(args) MyClass uses in internals some variable which is not defined in MyClass itself. I want to extend instance of MyClass at runtime defining this variable and making new instance. It is like a class i

Re: Incorrect scope of list comprehension variables

2010-04-17 Thread Dave Angel
Steven D'Aprano wrote: On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: Nevertheless, it is a common intuition that the list comp variable should *not* be exposed outside of the list comp, and that the for-l

Re: extract substring by regex from a text file

2010-04-17 Thread Peter Otten
Alessio wrote: > I used readlines() to read my text file, then with a for cicle I > extract line by line the substrings I need by regular expressions Just in case you didn't know: for line in instream: ... looks better, uses less memory, and may be a tad faster than for line in

Re: extract substring by regex from a text file

2010-04-17 Thread Stefan Behnel
Alessio, 17.04.2010 10:19: I used readlines() to read my text file, then with a for cicle I extract line by line the substrings I need by regular expressions (re.findall()) Note that it's usually more efficient to just run the for-loop over the file object, rather than using readlines() first.

Re: extract substring by regex from a text file

2010-04-17 Thread Alessio
On Apr 15, 3:25 pm, Neil Cerutti wrote: > On 2010-04-15, Alessio wrote: > > > Hi, > > > I'm facing the problem in the subject: > > - I have a text file that I need to parse for producing a specifical Thank you, I forgot to say that I already solved. I used readlines() to read my text file, then w

Re: Reactive programming in Python ?

2010-04-17 Thread pca
On Apr 17, 8:09 am, Stefan Behnel wrote: > pca, 16.04.2010 22:02: > > > On Apr 16, 8:28 pm, Stefan Behnel wrote: > >> pca, 16.04.2010 17:18: > > >>> In fact, I have seeded an open-source project, Yoopf, that enables > >>> programming by formula within Python, with the goal of dramatically > >>> ac

An open source AI research project

2010-04-17 Thread David Zhang
Hello! I have started an open source project to develop human-level Artificial Intelligence, using Python and Java as programming language, OpenCog and OpenWonderland as basement. If you are interested in this,or want to know more, please feel free to give me a reply. Thanks! David Zhang -- htt