Re: Numpy module

2012-10-28 Thread Chris Rebert
On Sun, Oct 28, 2012 at 10:40 PM, wrote: > I've learned a lot about Ubuntu just trying to install numpy for Python > 3.2.3. I've finally managed to put it in the Python3.2 directory but when I > try to import it, I still get there's "no module named numpy." There are > other modules in the sam

Numpy module

2012-10-28 Thread farrellpolymath
Hello to the group! I've learned a lot about Ubuntu just trying to install numpy for Python 3.2.3. I've finally managed to put it in the Python3.2 directory but when I try to import it, I still get there's "no module named numpy." There are other modules in the same directory, like 'email' and

Re: Negative array indicies and slice()

2012-10-28 Thread Paul Rubin
Andrew writes: > So: Why does python choose to convert them to positive indexes, and > have slice operate differently than xrange There was a thread a few years back, I think started by Bryan Olson, that made the case that slice indexing is a Python wart for further reasons than the above, and s

Re: Re: Simple Python question for some

2012-10-28 Thread Chris Angelico
On Mon, Oct 29, 2012 at 3:30 PM, Evan Driscoll wrote: > On 10/28/2012 7:18 PM, Chris Angelico wrote: >> Which means that strings will ALWAYS be compared as strings, and >> numbers will ALWAYS be compared as numbers, and ne'er the twain shall >> conflict. I can trust Python to compare MD5 hashes re

Re: Negative array indicies and slice()

2012-10-28 Thread alex23
On Oct 29, 2:09 pm, Andrew wrote: > I use this arbitrary range code *often* so I need a general purpose solution. > I looked up slice() but the help is of no use, I don't even know how I might > overload it to embed some logic to concatenate ranges of data; nor even if > it is possible. Slices ar

Re: Re: Simple Python question for some

2012-10-28 Thread Evan Driscoll
On 10/28/2012 7:18 PM, Chris Rebert wrote: > This is fixed in Python 3, where such nonsensical comparisons will > instead raise TypeError. It's worth pointing out that at least one kind of inequality comparison which some people (e.g. me) would consider nonsensical is still allowed in Python 3, wh

Re: Negative array indicies and slice()

2012-10-28 Thread Ian Kelly
On Sun, Oct 28, 2012 at 10:00 PM, wrote: > Hi Ian, > Well, no it really isn't equivalent. > Consider a programmer who writes: > xrange(-4,3) *wants* [-4,-3,-2,-1,0,1,2] > > That is the "idea" of a range; for what reason would anyone *EVER* want -4 to > +3 to be 6:3??? That is what ranges do, bu

Re: Negative array indicies and slice()

2012-10-28 Thread Andrew
On Sunday, October 28, 2012 8:43:30 PM UTC-7, Ian wrote: > On Sun, Oct 28, 2012 at 9:12 PM, wrote: > > > The slice operator does not give any way (I can find!) to take slices from > > negative to positive indexes, although the range is not empty, nor the > > expected indexes out of range that

Re: Negative array indicies and slice()

2012-10-28 Thread andrewr3mail
On Sunday, October 28, 2012 8:43:30 PM UTC-7, Ian wrote: > On Sun, Oct 28, 2012 at 9:12 PM, andrew wrote: > > > The slice operator does not give any way (I can find!) to take slices from > > negative to positive indexes, although the range is not empty, nor the > > expected indexes out of range

Re: Negative array indicies and slice()

2012-10-28 Thread MRAB
On 2012-10-29 03:12, andrewr3m...@gmail.com wrote: The slice operator does not give any way (I can find!) to take slices from negative to positive indexes, although the range is not empty, nor the expected indexes out of range that I am supplying. Many programs that I write would require intro

Re: Negative array indicies and slice()

2012-10-28 Thread Ian Kelly
On Sun, Oct 28, 2012 at 9:12 PM, wrote: > The slice operator does not give any way (I can find!) to take slices from > negative to positive indexes, although the range is not empty, nor the > expected indexes out of range that I am supplying. > > Many programs that I write would require introdu

Re: question on subprogram parameter

2012-10-28 Thread MRAB
On 2012-10-29 03:03, skyworld wrote: Hi, I'm studying python now and I saw a piece of code like this: def storeDbase(db, dbfilename=dbfilename): . dbfile=open(dbfilename,'w') for key in db: print(key, file=dbfile) can anybody help me to understand what does th

Negative array indicies and slice()

2012-10-28 Thread andrewr3mail
The slice operator does not give any way (I can find!) to take slices from negative to positive indexes, although the range is not empty, nor the expected indexes out of range that I am supplying. Many programs that I write would require introducing variables and logical statements to correct t

question on subprogram parameter

2012-10-28 Thread skyworld
Hi, I'm studying python now and I saw a piece of code like this: def storeDbase(db, dbfilename=dbfilename): . dbfile=open(dbfilename,'w') for key in db: print(key, file=dbfile) can anybody help me to understand what does this "file=dbfile" mean and what is its funct

Re: Where are documentation for Gnome

2012-10-28 Thread Walter Hurry
On Sun, 28 Oct 2012 16:29:07 +, Mark Lawrence wrote: > On 13/10/2012 18:49, Santosh Kumar wrote: >> >> > Try your local garden centre. Or: The Burrow, Ottery St. Catchpole, Devon, England -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python question for some

2012-10-28 Thread Chris Angelico
On Mon, Oct 29, 2012 at 10:51 AM, Mark L. Hotz wrote: > At the IDLE prompt, when I enter “b” > 99, it responds True. In fact, it > doesn’t matter which number is entered here, “b” is always greater (e.g. “b” >> 1 == True; “b” > 10 == True, or “b” < 99 = False). To Python, different object typ

Re: Simple Python question for some

2012-10-28 Thread Chris Rebert
On Sun, Oct 28, 2012 at 4:51 PM, Mark L. Hotz wrote: > I have what I think should be a relatively simple question for someone who > is knowledgeable about Python. > > At the IDLE prompt, when I enter “b” > 99, it responds True. In fact, it > doesn’t matter which number is entered here, “b” is alwa

Re: Simple Python question for some

2012-10-28 Thread Mark Lawrence
On 28/10/2012 23:51, Mark L. Hotz wrote: I have what I think should be a relatively simple question for someone who is knowledgeable about Python. Sorry you've come to the wrong place :) At the IDLE prompt, when I enter "b" > 99, it responds True. In fact, it doesn't matter which number is e

Re: Help understanding an Object Oriented Program example

2012-10-28 Thread Chris Angelico
On Mon, Oct 29, 2012 at 10:30 AM, goldtech wrote: > Hi, > > Trying to learn Python OOP. An example from a book, may not be > formated after sending post but: > > class Contact: > all_contacts = [] > def __init__(self, name, email): > self.name = name > self.email = email >

Re: Help understanding an Object Oriented Program example

2012-10-28 Thread Chris Rebert
On Sun, Oct 28, 2012 at 4:30 PM, goldtech wrote: > Hi, > > Trying to learn Python OOP. An example from a book, may not be > formated after sending post but: > > class Contact: > all_contacts = [] > def __init__(self, name, email): > self.name = name > self.email = email >

Simple Python question for some

2012-10-28 Thread Mark L. Hotz
I have what I think should be a relatively simple question for someone who is knowledgeable about Python. At the IDLE prompt, when I enter "b" > 99, it responds True. In fact, it doesn't matter which number is entered here, "b" is always greater (e.g. "b" > 1 == True; "b" > 10 == True, or "

Help understanding an Object Oriented Program example

2012-10-28 Thread goldtech
Hi, Trying to learn Python OOP. An example from a book, may not be formated after sending post but: class Contact: all_contacts = [] def __init__(self, name, email): self.name = name self.email = email Contact.all_contacts.append(self) OK, no I do this: >>> c = C

Re: Fast forward-backward (write-read)

2012-10-28 Thread Virgil Stokes
On 2012-10-28 19:21, Oscar Benjamin wrote: On 28 October 2012 14:20, Virgil Stokes wrote: On 28-Oct-2012 12:18, Dave Angel wrote: On 10/24/2012 03:14 AM, Virgil Stokes wrote: On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: Yes, I do wish to inverse the order, but the "forwar

Re: SSH Connection with Python

2012-10-28 Thread Gelonida N
On 10/26/2012 05:22 AM, Jason Friedman wrote: how can i create a SSH-Connection with python? I have to send some commands to the remote host and parse their answers. Consider also the sh module: http://amoffat.github.com/sh/tutorials/2-interacting_with_processes.html. Just a minor comment:

Re: SSH Connection with Python

2012-10-28 Thread Gelonida N
On 10/28/2012 02:35 AM, Cameron Simpson wrote: On 27Oct2012 14:18, Gelonida N wrote: | On 10/27/2012 02:21 AM, Roy Smith wrote: | > In article , | > Gelonida N wrote: | > | >> Another problem is, that paramiko depends on pycrypto 2.1+ | >> which doesn't exist as binary release for python 2.7

Re: Where are documentation for Gnome

2012-10-28 Thread GangGreene
On Sun, 28 Oct 2012 16:29:07 +, Mark Lawrence wrote: > On 13/10/2012 18:49, Santosh Kumar wrote: >> >> > Try your local garden centre. I inquired at the local garden centre, Just got strange looks Are you sure that is the correct place? ;) -- http://mail.python.org/mailman/listinfo/pyth

Re: Fast forward-backward (write-read)

2012-10-28 Thread Oscar Benjamin
On 28 October 2012 14:20, Virgil Stokes wrote: > On 28-Oct-2012 12:18, Dave Angel wrote: >> >> On 10/24/2012 03:14 AM, Virgil Stokes wrote: >>> >>> On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: > > Yes, I do wish to inverse the order, but the "forward in time" f

Re: Where are documentation for Gnome

2012-10-28 Thread Mark Lawrence
On 13/10/2012 18:49, Santosh Kumar wrote: Try your local garden centre. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Questions

2012-10-28 Thread Joshua Landau
On 16 October 2012 18:23, Ian Kelly wrote: > On Tue, Oct 16, 2012 at 9:21 AM, Demian Brecht > wrote: > > There's a small light somewhere deep down that says maybe this is just > > someone quite misdirected. A brief search shows that he has multiple > > domains, all with the same type of design.

Re: Error compiling python3.2.3: architecture of input file is incompatible

2012-10-28 Thread Tobias Marquardt
Am 28.10.2012 03:00, schrieb python-list-requ...@python.org: It looks like you've copied *.o files from your 64 bit build to your 32 bit box. If that's your problem, then the easiest solution is to delete everything and start over. Alternatively, you could run "make distclean"; that will delete

Re: Fast forward-backward (write-read)

2012-10-28 Thread Virgil Stokes
On 28-Oct-2012 12:18, Dave Angel wrote: On 10/24/2012 03:14 AM, Virgil Stokes wrote: On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: Yes, I do wish to inverse the order, but the "forward in time" file will be in binary. I really think it will be simplest to just write the file

Re: Style help for a Smalltalk-hack

2012-10-28 Thread Ethan Furman
Travis Griggs wrote: I'm writing some code that does a structured read from formatted binary file. The code I came up with looks like: # get the first four bytes, the first gap field chunk = byteStream.read(4) while chunk: # interpret the gap bytes gap, = struct.unpack('>I', chunk)

Re: a.index(float('nan')) fails

2012-10-28 Thread Ethan Furman
Steven D'Aprano wrote: The list.index method tests for the item with equality. Since NANs are mandated to compare unequal to anything, including themselves, index cannot match them. This is incorrect. .index() uses identity first, then equality, and will match the same NaN in a list. The OP

Re: ANN: Urwid 1.1.0 - Usability and Documentation

2012-10-28 Thread Rita
+1 great library. I suppose it will never be in the standard library? :p On Wed, Oct 24, 2012 at 5:08 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > - Original Message - > > Announcing Urwid 1.1.0 > > -- > > > > Urwid home page: > > http://excess.org

Re: Fast forward-backward (write-read)

2012-10-28 Thread Dave Angel
On 10/24/2012 03:14 AM, Virgil Stokes wrote: > On 24-Oct-2012 01:46, Paul Rubin wrote: >> Virgil Stokes writes: >>> Yes, I do wish to inverse the order, but the "forward in time" file >>> will be in binary. >> I really think it will be simplest to just write the file in forward >> order, then use

Re: attaching names to subexpressions

2012-10-28 Thread Chris Angelico
On Sun, Oct 28, 2012 at 6:12 PM, F.R. wrote: > > How about: > > line = True > while line: > > line = function(x, y, z) > do something with(line) > > ? That's going to go through the body of the loop with a false line before breaking out. In some situations that's not a problem, bu

Re: fastest data / database format for reading large files

2012-10-28 Thread Chris Rebert
On Tue, Oct 16, 2012 at 11:35 AM, Pradipto Banerjee wrote: > I am working with a series of large files with sizes 4 to 10GB and may need > to read these files repeated. What data format (i.e. pickle, json, csv, etc.) > is considered the fastest for reading via python? Pickle /ought/ to be faste

Re: ANN: Urwid 1.1.0 - Usability and Documentation

2012-10-28 Thread Jean-Michel Pichavant
- Original Message - > Announcing Urwid 1.1.0 > -- > > Urwid home page: > http://excess.org/urwid/ > > Manual: > http://excess.org/urwid/docs/ > > Package: > http://pypi.python.org/pypi/urwid/1.1.0 > > [snip] Hi, I just had a look at it. Amazing job. JM

Re: Fast forward-backward (write-read)

2012-10-28 Thread David Hutto
> Data files have some sort of parsing, unless it's one huge dict, or > list, so there has to be an average size to the parse. > Not meaning the dict, or list isn't parsed, but that the file should be have parsable areas. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http

Re: problem with ThreadingTCPServer Handler

2012-10-28 Thread jorge
Tanks a lot, it was really helpful El 23/10/12 16:51, Miki Tebeka escribió: According to the docs (http://docs.python.org/library/socketserver.html#requesthandler-objects) there's self.server available. 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS... CONE

Re: OT Questions

2012-10-28 Thread Demian Brecht
> > You haven't been on lists long enough then to have seen some real > flame warts...no offense. No offense taken, it's why I said it in the first place ;) Having said that, generally engaging in flame wars solves nothing and sheds a negative light on the individuals who take part in it. > It

fastest data / database format for reading large files

2012-10-28 Thread Pradipto Banerjee
I am working with a series of large files with sizes 4 to 10GB and may need to read these files repeated. What data format (i.e. pickle, json, csv, etc.) is considered the fastest for reading via python? Thanks This communication is for informational purposes on

Re: Fast forward-backward (write-read)

2012-10-28 Thread Virgil Stokes
On 24-Oct-2012 01:46, Paul Rubin wrote: Virgil Stokes writes: Yes, I do wish to inverse the order, but the "forward in time" file will be in binary. I really think it will be simplest to just write the file in forward order, then use mmap to read it one record at a time. It might be possible

Re: Aggressive language on python-list

2012-10-28 Thread Dwight Hutto
On Wed, Oct 17, 2012 at 10:21 PM, wu wei wrote: >> You don't know me > > No, I really do. Then tell me more about myself...doc. Your behaviour isn't as clever or as masking as you think > it is. It's intended to be involved, witty, and as informed as I can be on a topic by someone I'm conversing

Re: notmm is dead!

2012-10-28 Thread ian douglas
On 10/05/2012 12:37 PM, Prasad, Ramit wrote: I might be misunderstanding, but I think Etienne wants money in exchange for letting someone else take over. Not to stir up the hornet's nest any more, but it also sounds like now he wants money for people to license things as well: "The license fee

fastest data / database format for reading large files

2012-10-28 Thread Pradipto Banerjee
I am working with a series of large files with sizes 4 to 10GB and may need to read these files repeated. What data format (i.e. pickle, json, csv, etc.) is considered the fastest for reading via python? Thanks This communication is for informational purposes only. It is not intended to be, n

Re: problems with xml parsing (python 3.3)

2012-10-28 Thread Dieter Maurer
janni...@gmail.com writes: > I am new to Python and have a problem with the behaviour of the xml parser. > Assume we have this xml document: > > > > > Title of the first book. > > > > Title of the second book. > > > > > If I now chec

Re: attaching names to subexpressions

2012-10-28 Thread F.R.
On 10/28/2012 06:57 AM, Devin Jeanpierre wrote: line = function(x, y, z) >while line: > do something with(line) > line = function(x, y, z) How about: line = True while line: line = function(x, y, z) do something with(line) ? Frederic -- http://mail.python.org/mail

Re: attaching names to subexpressions

2012-10-28 Thread Steven D'Aprano
On Sun, 28 Oct 2012 01:57:45 -0400, Devin Jeanpierre wrote: > We have a problem, and two solutions. Solution 1 has downside A, and > solution 2 has downside B. If he complains about downside A, you say, > well, use solution 2. If he complains about downside B, you say, well, > use solution 1. > >