Re: is python Object oriented??

2009-01-31 Thread Marc 'BlackJack' Rintsch
On Sat, 31 Jan 2009 15:28:14 -0800, thmpsn.m.k wrote: > On Jan 31, 2:27 pm, Christian Heimes wrote: >> Do you honestly believe that C++'s private members are really private? >> Privateness is only enforced during parsing time. Nobody can stop you >> from messing around with header files or memory

what IDE is the best to write python?

2009-01-31 Thread mcheun...@hotmail.com
Hi all what IDE is the best to write python? thanks from Peter (mcheun...@hotmail.com) -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Address already in use')

2009-01-31 Thread Laszlo Nagy
8<-- ... Setting the SO_REUSEADDR flag on POSIX fixes this problem (don't set it on Windows, though). Why not? I have been merrily setting it, and I have not noticed anything weird. (yet) Please see my original post. I specifically stated that I d

Re: Embedding numpy works once, but not twice??

2009-01-31 Thread r
> Embedding numpy works once, but not twice?? That's what she said! -- http://mail.python.org/mailman/listinfo/python-list

PyNutButter BETA 1.0.0 - Automates CSV data Importation into any website http/https and/or mysql database

2009-01-31 Thread alex goretoy
Introducing PynutButter BETA 1.0.0 Automates csv data importation into any website. Or your money back. Programs like this idea of a program I have here cost $2500. Pynutbutter is opensource. You can use the code anyway you want. As long as I get my credit where it is due. I've worked on this proj

Re: Embedding numpy works once, but not twice??

2009-01-31 Thread David Cournapeau
On Sun, Feb 1, 2009 at 2:47 PM, Deepak Chandran wrote: > I have a program in which I have successfully embedded Python. Now, I want > to include NumPy as well (and other modules). I am able to import numpy > once. Then I close the python console in my program and then re-open it. > When I try to i

Re: nth root

2009-01-31 Thread Paul Rubin
"Tim Roberts" writes: > for root in powersp: > nroot = round(bignum**(1.0/root)) > if bignum==long(nroot)**root: > . > which is probably very inefficient

RE: nth root

2009-01-31 Thread Tim Roberts
Paul, Yes, very good, on all counts. Many thanks. Tim From: Paul Rubin [mailto:"http://phr.cx"@NOSPAM.invalid] Sent: Sun 01-Feb-09 3:53 PM To: python-list@python.org Subject: Re: nth root "Tim Roberts" writes: > Actually, all I'm interested in is whethe

Re: Searching a file for multiple strings (PS)

2009-01-31 Thread John Machin
On Feb 1, 3:39 pm, Shawn Milochik wrote: > Not to discourage the use of Python, but it seems that fgrep with the > -f flag already does exactly what you want. If you're on Windows, you > can get the Windows version of fgrep here: http://unxutils.sourceforge.net/ That URL is antique and a dead en

Re: nth root

2009-01-31 Thread Paul Rubin
"Tim Roberts" writes: > Actually, all I'm interested in is whether the 100 digit numbers > have an exact integral root, or not. At the moment, because of > accuracy concerns, I'm doing something like > > for root in powersp: > nroot = round(bignum

Embedding numpy works once, but not twice??

2009-01-31 Thread Deepak Chandran
I have a program in which I have successfully embedded Python. Now, I want to include NumPy as well (and other modules). I am able to import numpy once. Then I close the python console in my program and then re-open it. When I try to import numpy for a second time, the program crashes. Below is a s

RE: nth root

2009-01-31 Thread Tim Roberts
Actually, all I'm interested in is whether the 100 digit numbers have an exact integral root, or not. At the moment, because of accuracy concerns, I'm doing something like for root in powersp: nroot = round(bignum**(1.0/root))

Re: Searching a file for multiple strings (PS)

2009-01-31 Thread Shawn Milochik
On Sat, Jan 31, 2009 at 3:00 PM, Tim Chase wrote: >>> I'm fairly new with python and am trying to build a fairly simple >>> search script. Ultimately, I'm wanting to search a directory of files >>> for multiple user inputted keywords. I've already written a script >>> that can search for a singl

Re: is python Object oriented??

2009-01-31 Thread David Bolen
thmpsn@gmail.com writes: > I don't know how you would do it in C# (or Java for that matter). > > In C++ you can play with pointers to "get at" some memory location > somewhere in the object. The only portable way to know the exact > location between the beginning of the object and the desired

Re: importlib: what is it, and why is it important?

2009-01-31 Thread Benjamin Peterson
excord80 gmail.com> writes: > > Regarding this blog post: http://sayspy.blogspot.com/2009/01/importlib-is-now-in-python-31.html Brett has made many other blog posts about his work on importlib. You might try examining those. > > So, could someone explain what importlib exactly is, and why thi

importlib: what is it, and why is it important?

2009-01-31 Thread excord80
Regarding this blog post: http://sayspy.blogspot.com/2009/01/importlib-is-now-in-python-31.html When I use the ``import foo`` statement at the top of my program, I get a module imported. python has a search path it follows, finds the module, and makes it available to my program. Works nice. :) S

Re: Tutorial on working with Excel files in Python (without COM and cross platform!) at PyConUS 2009

2009-01-31 Thread Glenn Linderman
On approximately 1/27/2009 5:19 PM, came the following characters from the keyboard of Chris Withers: Hi All, Too many people in the Python community think the only way to work with Excel files in Python is using COM on Windows. To try and correct this, I'm giving a tutorial at this year's PyCo

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote: > More interestingly, though, most compilers translate C and C++ code to > assembler first. Does that mean that you can do object-oriented > programming, generic programming, and procedural programming in > assembler? > > Answer: No, but you can probably -- very clumsily

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-31 Thread r
On Jan 31, 7:24 pm, John Machin wrote: > A most munificent malapropism! Sherman's goat must be serene with > entropy!! Who say's George Bush did't have anything to offer :). He was the decider after all. -- http://mail.python.org/mailman/listinfo/python-list

Re: help me python

2009-01-31 Thread Robert Kern
On 2009-01-31 19:52, John Machin wrote: On Feb 1, 11:09 am, andrew cooke wrote: On Jan 31, 5:36 pm, aolsu...@gmail.com wrote: C:\Python26>vnc.py Traceback (most recent call last): File "C:\Python26\vnc.py", line 4, in import PyD3DES ImportError: DLL load failed: The specified module c

Re: Where to host a (Python) project?

2009-01-31 Thread Roy H. Han
I really like WebFaction for web-based Python projects. It's a paid web-hosting service, though. What I like is how they always have the most up-to-date Python packages and frameworks using one-click installers. On Sat, Jan 31, 2009 at 4:30 PM, andrew cooke wrote: > On Jan 31, 4:50 pm, "Giampao

Re: help me python

2009-01-31 Thread John Machin
On Feb 1, 11:09 am, andrew cooke wrote: > On Jan 31, 5:36 pm, aolsu...@gmail.com wrote: > > > C:\Python26>vnc.py > > Traceback (most recent call last): > >   File "C:\Python26\vnc.py", line 4, in > >     import PyD3DES > > ImportError: DLL load failed: The specified module could not be found. > >

Re: Where to host a (Python) project?

2009-01-31 Thread Jesse Noller
On Sat, Jan 31, 2009 at 4:30 PM, andrew cooke wrote: > On Jan 31, 4:50 pm, "Giampaolo Rodola'" wrote: >> Google Code. >> >> --- Giampaolohttp://code.google.com/p/pyftpdlib > > thanks - that's a nice example. i'm a bit concerned about the whole > google corporation thing, but reading through the

Re: Import Replacement

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 18:22:54 -0200, Gary Herron escribió: James Pruitt wrote: Imagine there are two files horse.py and buffalo.py. horse.py is imported by another file rider.py. Is it possible to make it so that under certain circumstances possibly based on an environment variable or somethi

Re: install modules for specific python version

2009-01-31 Thread John Machin
On Feb 1, 12:00 pm, Brendan Miller wrote: > -BEGIN PGP SIGNED MESSAGE- > I have several version of python running side by side on my ubuntu > install (2.5,2.6,3.0). > > I'm installing a module with a setup.py script, in this case > logilab-common, so that I can get pylint going. However,

Re: install modules for specific python version

2009-01-31 Thread Robert Kern
On 2009-01-31 19:00, Brendan Miller wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have several version of python running side by side on my ubuntu install (2.5,2.6,3.0). I'm installing a module with a setup.py script, in this case logilab-common, so that I can get pylint going. However

install modules for specific python version

2009-01-31 Thread Brendan Miller
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have several version of python running side by side on my ubuntu install (2.5,2.6,3.0). I'm installing a module with a setup.py script, in this case logilab-common, so that I can get pylint going. However, I need to install into python 2.6, but by d

Re: receive and react to MIDI input

2009-01-31 Thread r
Sorry i gave you the wrong module, try PMIDI for python 2.5 (win32.exe): http://sourceforge.net/project/showfiles.php?group_id=65529&package_id=106729 Also try this page near the bottom under "MIDI Mania" for more http://wiki.python.org/moin/PythonInMusic -- http://mail.python.org/mailman/listinfo

Re: Newbie Question: Can't multiply sequence by non-int of type 'str'

2009-01-31 Thread Paulo Repreza
Hi, Thanks for your reply. It worked. Paulo Repreza On Sat, Jan 31, 2009 at 4:25 PM, Robert Kern wrote: > On 2009-01-31 18:19, Paulo Repreza wrote: > >> Hi, >> I'm just learning the very basics of python and I ran into this problem >> in version 3.0/3000: >> >>>x = input("x: ") >> x: 36 >> >

Re: Newbie Question: Can't multiply sequence by non-int of type 'str'

2009-01-31 Thread Robert Kern
On 2009-01-31 18:19, Paulo Repreza wrote: Hi, I'm just learning the very basics of python and I ran into this problem in version 3.0/3000: >>>x = input("x: ") x: 36 >>> y = input("y: ") y: 42 >>> print (x*y) Traceback (most recent call last): File "", line 1, in print (x*y) TypeError: can't m

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-31 Thread r
On Jan 30, 4:36 pm, Steve Holden wrote: [snip] > It's mostly a matter of teaching by example. I'd like to think I usually > set a good example, but I've certainly been known to get crabby from time > to time Steve you are defiantly the better of two evils around here :D -- http://mail.python.org/

Newbie Question: Can't multiply sequence by non-int of type 'str'

2009-01-31 Thread Paulo Repreza
Hi, I'm just learning the very basics of python and I ran into this problem in version 3.0/3000: >>>x = input("x: ") x: 36 >>> y = input("y: ") y: 42 >>> print (x*y) Traceback (most recent call last): File "", line 1, in print (x*y) TypeError: can't multiply sequence by non-int of type 'st

Re: help me python

2009-01-31 Thread andrew cooke
On Jan 31, 5:36 pm, aolsu...@gmail.com wrote: > C:\Python26>vnc.py > Traceback (most recent call last): >   File "C:\Python26\vnc.py", line 4, in >     import PyD3DES > ImportError: DLL load failed: The specified module could not be found. i'm surprised no-one has replied here. what is happening

Re: nth root

2009-01-31 Thread Tim Roberts
"Tim Roberts" wrote: > >Thanks - you're probably right - just my intuition said to me that rather than >calculating that the 13th root of >4021503534212915433093809093996098953996019232 >is 3221.2904208350265 >there must be a quicker way of finding out its between 3221 and 3222 > >

Re: nth root

2009-01-31 Thread Robert Kern
On 2009-01-30 22:00, Tim Roberts wrote: Unfortunately, unless I'm doing something wrong, this appears to take 20 times as long... :-) What on earth are numpy and psyco? Do I need to watch the Lord of the Rings? No, but Google would help. -- Robert Kern "I have come to believe that the whol

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread Stephen Hansen
Cheers mate I had a look into twisted but was put off by the FAQ stating 1.0+ modules may or may not be stable, and only the 'core' is. I don't wanna be messing around with a potentially buggy server, so im gonna roll my own using the sockets module. You didn't read that FAQ right: its addres

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 31, 2:27 pm, Christian Heimes wrote: > thmpsn@gmail.com schrieb: > > > But it's only a faking, and things such as inheritance and > > polymorphism are implemented clumsily (actually I'm not even sure > > about polymorphism). And of course, there are still no private > > members. > > Do

Re: Tkinter w.pack()?

2009-01-31 Thread Steve Holden
W. eWatson wrote: > Steve Holden wrote: >> W. eWatson wrote: >>> r wrote: On Jan 28, 10:12 pm, "W. eWatson" wrote: > Where in the world is a description of pack() for Tkinter widgets? > Is it > some sort of general method for all widgets? I'm looking in a few > docs that >

Re: SimpleXMLRPCServer question

2009-01-31 Thread rdmurray
Quoth flagg : > Let me see if i can elaborate on the requirements. I have 20+ > different zone files. I want the xmlrpc server to be able to > determine what zone file to open by looking at the incoming xml > request. For example one of the functions I have now is to show a DNS > record (I am us

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
Steve Holden wrote: > You can think what you like, but there is a fundamental difference > between methods of a class and functions of a module. Until you > appreciate that you will likely make mistakes. Don't worry, though, we > all learn from our mistakes. And this fundamental difference is? >F

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote: >> To be clear, python does not force you to lay out your code according to >> some strict object-oriented paradigm. But Python itself is still purely >> object-oriented, as is your script when parsed. > > But it's only a faking, and things such as inheritance and > pol

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote >> This allows people to meddle with internals, at their own risk, >> if it ends up being absolutely necessary. > > If it ends up being necessary, the class's design is flawed. (Though > in this case, the flaw is easily solved by simply providing a getter.) No the class

Re: Where to host a (Python) project?

2009-01-31 Thread andrew cooke
On Jan 31, 4:50 pm, "Giampaolo Rodola'" wrote: > Google Code. > > --- Giampaolohttp://code.google.com/p/pyftpdlib thanks - that's a nice example. i'm a bit concerned about the whole google corporation thing, but reading through the ideological check- sheet at savannah convinced me i wasn't worth

help me python

2009-01-31 Thread aolsuppo
C:\Python26>vnc.py Traceback (most recent call last): File "C:\Python26\vnc.py", line 4, in import PyD3DES ImportError: DLL load failed: The specified module could not be found. -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-01-31 Thread Christian Heimes
thmpsn@gmail.com schrieb: > But it's only a faking, and things such as inheritance and > polymorphism are implemented clumsily (actually I'm not even sure > about polymorphism). And of course, there are still no private > members. Do you honestly believe that C++'s private members are really p

Re: Import Replacement

2009-01-31 Thread Gary Herron
James Pruitt wrote: > Imagine there are two files horse.py and buffalo.py. horse.py is > imported by another file rider.py. Is it possible to make it so that > under certain circumstances possibly based on an environment variable > or something similar that when rider.py imports horse.py, it actual

Re: Where to host a (Python) project?

2009-01-31 Thread Andrey Demidov
I use Google Code. -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer question

2009-01-31 Thread flagg
On Jan 30, 8:12 pm, rdmur...@bitdance.com wrote: > Quoth flagg : > > > I am working on a very basic xmlrpc server, which will expose certain > > functions for administering BIND zone files.  The big problem I am > > having is parsing the incoming xmlrpc request.  Basically part of the > > xmlrpc re

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 7:04 pm, ajaksu wrote: > also a great way make some innocent bystander waste his eyesight > trying to figure out the magic trick :D Oh, come on! At least I put the two lines next to each other! :-) Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching a file for multiple strings (PS)

2009-01-31 Thread Tim Chase
I'm fairly new with python and am trying to build a fairly simple search script. Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords. I've already written a script that can search for a single string through multiple files, now I just need to adapt it to mu

Re: Where to host a (Python) project?

2009-01-31 Thread Giampaolo Rodola'
On 31 Gen, 12:46, andrew cooke wrote: > Hi, > > I have a new project, that I just released in beta > (http://www.acooke.org/lepl- a recursive decent parser with full > backtracking).  At the moment I am using pypi and setuptools for > distribution (it's a pure python package) and I am happy with

Re: Searching a file for multiple strings

2009-01-31 Thread Tim Chase
I'm fairly new with python and am trying to build a fairly simple search script. Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords. I've already written a script that can search for a single string through multiple files, now I just need to adapt it to mu

Re: is python Object oriented??

2009-01-31 Thread Andreas Waldenburger
On Sat, 31 Jan 2009 09:11:03 +0100 Laszlo Nagy wrote: > Python is not a pure object oriented language, because it has other > programming tools, for example functions. I'm not sure about the first part of the sentence, but Python's functions are objects. Check it in the interpreter: attributes,

Import Replacement

2009-01-31 Thread James Pruitt
Imagine there are two files horse.py and buffalo.py. horse.py is imported by another file rider.py. Is it possible to make it so that under certain circumstances possibly based on an environment variable or something similar that when rider.py imports horse.py, it actually imports buffalo.py sort o

Import Replacement

2009-01-31 Thread James Pruitt
Imagine there are two files horse.py and buffalo.py. horse.py is imported by another file rider.py. Is it possible to make it so that under certain circumstances possibly based on an environment variable or something similar that when rider.py imports horse.py, it actually imports buffalo.py sort o

Re: len()

2009-01-31 Thread Andreas Waldenburger
On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: > Tobiah wrote: > > Just out of curiosity, why was len() made to > > be it's own function? I often find myself > > typing things like my_list.len before I > > catch myself. > > > > Thanks, > > > > Toby > > I'm surprised that no one responded to th

Searching a file for multiple strings

2009-01-31 Thread gotbyrd
Hello, I'm fairly new with python and am trying to build a fairly simple search script. Ultimately, I'm wanting to search a directory of files for multiple user inputted keywords. I've already written a script that can search for a single string through multiple files, now I just need to adapt i

Re: Python-list Digest, Vol 64, Issue 697

2009-01-31 Thread AJ Ostergaard
AJ Ostergaard wrote: I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the expression is "and" and therefore should always return

Re: search speed

2009-01-31 Thread Tim Rowe
2009/1/30 Scott David Daniels : > Be careful with your assertion that a regex is faster, it is certainly > not always true. I was careful *not* to assert that a regex would be faster, merely that it was *likely* to be in this case. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-

Re: nth root

2009-01-31 Thread ajaksu
On Jan 31, 12:03 pm, Mark Dickinson wrote: [...] > t1 = timeit.Timer("x = n**power", "n = > 4021503534212915433093809093996098953996019232; power = 1./13") > t2 = timeit.Timer("x = n**power", "n = > 4021503534212915433093809093996098953996019232.; power = 1./13") And by using a float literal in

Re: Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread Martin v. Löwis
> I see for 2.5 and > for 2.6. I'm guessing these two pages differ > somewhat in formats simply because someone decided to do so, and not > that I'm in the wrong place for each of the two versions, correct? Correct. The documentation forma

Re: Empty string is False right?

2009-01-31 Thread Scott David Daniels
Steve Holden wrote: AJ Ostergaard wrote: I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the expression is "and" and therefore shoul

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Scott David Daniels
Csaba Hoch wrote: if I write the following: >>> 1+1 2 it seems to be exactly equivalent to this: >>> (1).__add__(1) 2 However, if I write invalid code and try to add a list to an int, the errors will be different: As has been explained, binary operators are trickier than the a

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 30, 2:32 pm, Michael Torrie wrote: > Veerendra Ganiger wrote: > > Python is not purely object oriented programming, because we can write > > functions without any class. > > You are right, predefined class attributes are available when we write or > > execute a piece of python code without

Re: nth root

2009-01-31 Thread Dan Goodman
Mark Dickinson wrote: Well, random numbers is one thing. But how about the following: n = 12345**13 n 154662214940914131102165197707101295849230845947265625L int(n ** (1./13)) # should be 12345; okay 12345 int((n-1) ** (1./13)) # should be 12344; oops! 12345 Good point! Oops indeed. :

Re: Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 9:14 AM, W. eWatson wrote:I see for 2.5 and for 2.6. I'm guessing these two pages differ somewhat in formats simply because someone decided to do so, and not that I'm in the wrong place for each of the two versions,

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread markobrien85
On Jan 30, 5:54 am, Jean-Paul Calderone wrote: > On Thu, 29 Jan 2009 08:38:43 -0800 (PST), markobrie...@gmail.com wrote: > >G'day > > >I'm currentlyusingsocketserverto build a simple XMLSocket (an XML > >based protocol used for communication between flash and the outside > >world) server. I've got

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 4:48 pm, Dan Goodman wrote: > I don't think accuracy is too big a problem here actually (at least for > 13th roots). I just tested it with several hundred thousand random 100 > digit numbers and it never made a mistake. Well, random numbers is one thing. But how about the following:

Re: is python Object oriented??

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 9:08 AM, wrote:On Jan 30, 12:15 am, Chris Rebert wrote: > - Python supports encapsulation. Prefixing an attribute/method with an > underscore indicates that other programmers should treat it as > 'private'. However, unlike B&D languages, Python itsel

Re: nth root

2009-01-31 Thread Mensanator
On Jan 31, 10:53 am, Mensanator wrote: > On Jan 31, 8:05 am, Mark Dickinson wrote: > > > On Jan 31, 1:23 pm, Steve Holden wrote: > > > > Much more significant points, given the limited precision of the doubles > > > Python will be using. Could gmpy do this better, I wonder? > > > Almost certainl

Python Doc 2.6 vs 2.5--A Matter of Format?

2009-01-31 Thread W. eWatson
I see for 2.5 and for 2.6. I'm guessing these two pages differ somewhat in formats simply because someone decided to do so, and not that I'm in the wrong place for each of the two versions, correct? For example, somewhere down in the 2.5

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 30, 12:15 am, Chris Rebert wrote: > - Python supports encapsulation. Prefixing an attribute/method with an > underscore indicates that other programmers should treat it as > 'private'. However, unlike B&D languages, Python itself does nothing > to enforce this privacy, leaving it instead to

Re: Where to host a (Python) project?

2009-01-31 Thread ajaksu
On Jan 31, 1:03 pm, andrew cooke wrote: > On Jan 31, 11:22 am, eliben wrote: > > > code.google.com provides all of these in a free and convenient manner. > > Recommended. > > unfortunately google don't seem that reliable ;o)  (have you tried a > google search today?) You can mirror at LP, bitbuc

Re: Empty string is False right?

2009-01-31 Thread Stephen Hansen
On Sat, Jan 31, 2009 at 4:36 AM, AJ Ostergaard wrote:I'm not suggesting it's not operating as advertised - I'm suggesting the 'advertising' is slightly sguiffy if you catch my drift. I guess it's just me that finds it slightly counter intuitive. Surely intuitively the _expression_ is "and" and the

Re: nth root

2009-01-31 Thread Mensanator
On Jan 31, 8:05 am, Mark Dickinson wrote: > On Jan 31, 1:23 pm, Steve Holden wrote: > > > Much more significant points, given the limited precision of the doubles > > Python will be using. Could gmpy do this better, I wonder? > > Almost certainly, if exact results are wanted!  At least, GMP has >

Re: nth root

2009-01-31 Thread Dan Goodman
Mark Dickinson wrote: I'd also be a bit worried about accuracy. Is it important to you that the integer part of the result is *exactly* right, or is it okay if (n**13)**(1./13) sometimes comes out as slightly less than n, or if (n**13-1)**(1./13) sometimes comes out as n? I don't think accura

fastest way to detect a user type

2009-01-31 Thread Robin Becker
Whilst considering a port of old code to python 3 I see that in several places we are using type comparisons to control processing of user instances (as opposed to instances of built in types eg float, int, str) I find that the obvious alternatives are not as fast as the current code; func0 be

Re: Empty string is False right?

2009-01-31 Thread Diez B. Roggisch
AJ Ostergaard schrieb: Hi Ralf, Thanks for that but why: >>> '' and True '' Surely that should be False?!? No. Please read the section in the language reference about the and/or operators. "and" will return the first false value, or the right side. Thus '' and True -> '' True and '' ->

Re: glob.fnmatch (was "search speed")

2009-01-31 Thread rdmurray
Quoth Tim Chase : > rdmur...@bitdance.com wrote: > > What you want is: > > > > from fnmatch import fnmatch > > Oh, that's head-smackingly obvious now...thanks! > > My thought process usually goes something like > > """ > I want to do some file-name globbing > > there's a glob module that l

Re: Tkinter w.pack()?

2009-01-31 Thread W. eWatson
Gabriel Genellina wrote: En Thu, 29 Jan 2009 14:55:13 -0200, W. eWatson escribió: Gabriel Genellina wrote: En Thu, 29 Jan 2009 02:57:04 -0200, W. eWatson escribió: The word pack doesn't exist on the NMT pdf. Maybe there's a newer one? There is a PDF version of "An Introduction to Tkinter

Re: Tkinter w.pack()?

2009-01-31 Thread W. eWatson
Steve Holden wrote: W. eWatson wrote: r wrote: On Jan 28, 10:12 pm, "W. eWatson" wrote: Where in the world is a description of pack() for Tkinter widgets? Is it some sort of general method for all widgets? I'm looking in a few docs that use it without ever saying where it is described. For on

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-31 Thread Aahz
In article <7xr62ufv1c@ruckus.brouhaha.com>, Paul Rubin wrote: >a...@pythoncraft.com (Aahz) writes: >> >> CPython's "primitive" storage management has a lot to do with the >> simplicity of interfacing CPython with external libraries. Any solution >> that propose

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 11:03:13 -0200, andrew cooke escribió: Just a correction: according to the doc, NotImplemented is not an error, but a returned value. curious, so it is. i wonder why there is both a special return value (NotIMplemented) and a related exception (NotImplementedError).

Re: py2exe + SQLite problem

2009-01-31 Thread Gabriel Genellina
En Sat, 31 Jan 2009 11:51:16 -0200, Armin escribió: Gabriel Genellina wrote: En Fri, 30 Jan 2009 09:50:08 -0200, Armin escribió: Right at the end: "To install data files directly in the target directory, an empty string should be given as the directory." setup(..., data_files=[

Re: py2exe + SQLite problem

2009-01-31 Thread Thomas Heller
Armin schrieb: > As posted before ... set's my script (python 2.3): > > from distutils.core import setup > import py2exe > > setup(windows=['dpconf.py'], > data_files=[ "", ["proj_db","gsd_db","dachs2.xbm"]] > ) > > When I create the distribution I got the following err msg: > > *** c

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Christian Heimes
andrew cooke schrieb: >> Just a correction: according to the doc, NotImplemented is not an >> error, but a returned value. > > curious, so it is. i wonder why there is both a special return value > (NotIMplemented) and a related exception (NotImplementedError). seems > very odd to have a value..

Re: Where to host a (Python) project?

2009-01-31 Thread andrew cooke
On Jan 31, 11:22 am, eliben wrote: > code.google.com provides all of these in a free and convenient manner. > Recommended. unfortunately google don't seem that reliable ;o) (have you tried a google search today?) -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to host a (Python) project?

2009-01-31 Thread eliben
andrew cooke wrote: > Hi, > > I have a new project, that I just released in beta (http:// > www.acooke.org/lepl - a recursive decent parser with full > backtracking). At the moment I am using pypi and setuptools for > distribution (it's a pure python package) and I am happy with hosting > static

Re: Empty string is False right?

2009-01-31 Thread Grant Edwards
On 2009-01-31, Vlastimil Brom wrote: > 2009/1/31 AJ Ostergaard : >> Hi Ralf, >> >> Thanks for that but why: >> > '' and True >> '' >> >> Surely that should be False?!? >> >> Regards, >> AJ >> >> > see the docs: > http://docs.python.org/reference/expressions.html#boolean-operations > > "The exp

Re: Where to host a (Python) project?

2009-01-31 Thread Michele Simionato
On Jan 31, 12:46 pm, andrew cooke wrote: > Any recommendations? Google Code seems fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 1:23 pm, Steve Holden wrote: > Much more significant points, given the limited precision of the doubles > Python will be using. Could gmpy do this better, I wonder? Almost certainly, if exact results are wanted! At least, GMP has an mpz_root function; I don't know offhand whether gmpy

Re: nth root

2009-01-31 Thread Mark Dickinson
On Jan 31, 1:23 pm, Steve Holden wrote: > [Mark] > > power operation.  The integer -> float conversion is probably quite > > significant, timewise. > > I bow to your superior intuition! Here's another timing that shows the significance of the int -> float conversion: (non-debug build of the trunk

Re: py2exe + SQLite problem

2009-01-31 Thread Armin
Gabriel Genellina wrote: En Fri, 30 Jan 2009 09:50:08 -0200, Armin escribió: Right at the end: "To install data files directly in the target directory, an empty string should be given as the directory." setup(..., data_files=[ ('', ['list/of/file/names', 'perhaps/includi

Re: Where to host a (Python) project?

2009-01-31 Thread Martin
2009/1/31 andrew cooke : > On Jan 31, 9:59 am, Martin wrote: >> There's tigris.org, savannah (savannah.gnu.org, nongnu.org), >> launchpad. All of them are fine to some extent, you might want to read >> up on PyMotW about how Doug Hellmann decided where to host his stuff. > > all i can find is that

Re: glob.fnmatch (was "search speed")

2009-01-31 Thread Tim Chase
rdmur...@bitdance.com wrote: Quoth Tim Chase : PS: as an aside, how do I import just the fnmatch function? I tried both of the following and neither worked: from glob.fnmatch import fnmatch from glob import fnmatch.fnmatch I finally resorted to the contortion coded below in favor of

Re: Empty string is False right?

2009-01-31 Thread Steve Holden
AJ Ostergaard wrote: > I'm not suggesting it's not operating as advertised - I'm suggesting the > 'advertising' is slightly sguiffy if you catch my drift. I guess it's > just me that finds it slightly counter intuitive. Surely intuitively the > expression is "and" and therefore should always return

Re: Empty string is False right?

2009-01-31 Thread D'Arcy J.M. Cain
On Sat, 31 Jan 2009 12:16:19 + AJ Ostergaard wrote: > >>> '' and True > '' > > Surely that should be False?!? Why? The first value evaluates to False in a boolean context and thus is returned in the above statement due to short circuit evaluation but is not itself False. You wouldn't expe

Re: nth root

2009-01-31 Thread Steve Holden
Mark Dickinson wrote: > On Jan 31, 5:43 am, "Tim Roberts" wrote: >> Dan, >> >> Thanks - you're probably right - just my intuition said to me that rather >> than calculating that the 13th root of >> 4021503534212915433093809093996098953996019232 >> is 3221.2904208350265 >> there must be a qui

Re: Where to host a (Python) project?

2009-01-31 Thread andrew cooke
On Jan 31, 9:59 am, Martin wrote: > There's tigris.org, savannah (savannah.gnu.org, nongnu.org), > launchpad. All of them are fine to some extent, you might want to read > up on PyMotW about how Doug Hellmann decided where to host his stuff. all i can find is that he is writing his own! http://bl

Re: is python Object oriented??

2009-01-31 Thread Steve Holden
MC wrote: > Re > >> ‘builtin’ is not a class. > > I think "object" ; not only "class" > And "builtin" is an object. > You can think what you like, but there is a fundamental difference between methods of a class and functions of a module. Until you appreciate that you will likely make mistakes.

  1   2   >