On Mon, 18 Aug 2008 08:28:53 -0700, Dan Lenski wrote:
> So is there a bug in the Python docs? Does __slots__ in fact work with
> subclasses of tuple?
>
> Dan
Anybody think that this may actually be a mistake in the Python docs? Who
would I contact about getting them corrected?
On Mon, 18 Aug 2008 18:04:53 +, Dan Lenski wrote:
> On Mon, 18 Aug 2008 10:52:45 -0700, Alejandro wrote:
>
>> Hi:
>>
>> I need to find the multiples of a decimal number in a floating point
>> list. For instance, if a have the list [0,0.01,0.02,...1], I wa
On Mon, 18 Aug 2008 10:52:45 -0700, Alejandro wrote:
> Hi:
>
> I need to find the multiples of a decimal number in a floating point
> list. For instance, if a have the list [0,0.01,0.02,...1], I want the
> multiples of 0.2: [0, 0.2,0.4,0.6,0.8,1].
>
> With integers this problem is easy, just tes
On Mon, 18 Aug 2008 18:27:53 +0200, Peter Otten wrote:
> Dan Lenski wrote:
>> How does this play with standard precedence rules?
>
> Simple, all comparisons have the same priority:
>
> http://docs.python.org/ref/comparisons.html
>
> Peter
I see. So, since the comp
On Mon, 18 Aug 2008 18:04:32 +0200, Peter Otten wrote:
> This works just like a < b < c:
>
3 in [3] and [3] == True
> False
>
> Peter
Interesting. I agree with the OP that it is confusing!
Does this expansion really get invoked every time there is an expression
of the form??
expr1 binar
On Aug 13, 1:30 pm, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Trynamedtuplehttp://code.activestate.com/recipes/500261/
>
> Anamedtupleimplementation is part of Python 2.6 and 3.0. For older
> versions of Python use the recipe from activestate.
>
> Christian
This named tuple recipe is pretty co
On Fri, 15 Aug 2008 08:03:23 -0700, Carl Banks wrote:
> On Aug 14, 4:42 pm, Christian Heimes <[EMAIL PROTECTED]> wrote:
>> Integers
>> between -5 and +256 are singletons as are some other objects like
>> strings with one element or empty tuples.
>
> Not quite.
>
> Python 2.5.2 (r252:60911, May 2
gets created
when they are assigned to variables, so a=500 followed by m=500 will
create new objects.
The "is" operator just shows the effect of this caching. It's
unimportant for real code since you never care whether two numeric
variables refer to the same object (only impo
a connection when it says it's
going to? Any advice on improving the code is appreciated!
Thanks,
Dan Lenski
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 15, 3:19 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
> I think that is because normally the web server does the authentication on the
> server side. Why not use Apache to do the digest authentication?
>
> http://httpd.apache.org/docs/2.0/mod/mod_auth_digest.html
>
> -Larry
Hi Larry,
I'm so
Hi all,
I've got a very simple HTML proxy server to access the web from my
cell phone (based on this code: http://www.okisoft.co.jp/esc/python/proxy/).
It's a very retarded phone that freezes if there's no Content-Length
header and some other circumstances, so I have to tweak and modify the
headers
erik gartz wrote:
> Doesn't {} allocate new memory for the
> dictionary each time? It almost appears as if the 2nd dictionary
> created overwrites the first one. Thanks for your help,
> Erik
>
> >>>
> >>> a = [[{}] * 3] * 2
> >>> a
> [[{}, {}, {}], [{}, {}, {}]]
> >>> for i in range(2):
> a[
Why Tea wrote:
> How do I find out what python modules are installed on a Solaris
> platform?
>
> I tried to import numarray, but python couldn't find it.
>
> /Why Tea
They're usually stored in something like /usr/lib/python2.4
And you can find most of the available modules at
http://python.org/py
walterbyrd wrote:
> Some think it will.
>
> Up untill now, Java has never been standard across different versions
> of Linux and Unix. Some think that is one reason that some developers
> have avoided Java in favor of Python. Now that Java has been GPL'd that
> might change.
>
> IMO: it won't make
Hendrik van Rooyen wrote:
> This is true - and it is actually also an intractable problem - if you look at
> what your daughter wrote, you get the feeling that you should be able to write
> an interpreter that can implement what she meant, because it is quite clear to
> you - until you try to write
Ben Finney wrote:
> Readability doesn't vary directly or inversely with the number of
> characters, even though it is affected when they change.
Good point! Perl has more characters than Python, and I find they make
it harder to read because they are distracting.
Brainf*** (http://en.wikipedia.o
Carsten Haese wrote:
> On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote:
> > lennart wrote:
> > > So i ask myself is python the language I'm looking for?
> >
> > Yep! Python is very much a jack-of-all-trades language.
>
> I'll run the risk of b
lennart wrote:
> But I'm not a full-time programmer. I know, that I've only time &
> possibility to learn one (= 1) language good. So i ask myself is python
> the language I'm looking for?
Yep! Python is very much a jack-of-all-trades language. I've used it
for similar tasks, including as a fron
dischdennis wrote:
> the line "raise Singleton.__single" invokes in my class the following
> error:
>
> exceptions must be classes, instances, or strings (deprecated), not
> PurchaseRequisitionController
Denis,
Jason's explanation is correct! You are trying to use the Singleton
instance as the ex
Hendrik van Rooyen wrote:
> "Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
>
> 8<---
> > >>> color = "blue"
> > >>> if color == "red" or "green" or "yellow":
> > ... print color, "is red or green or yellow"
> > ...
> > blue is red or green or yellow
Eric Brunel wrote:
> On Thu, 09 Nov 2006 22:01:51 +0100, Dan Lenski <[EMAIL PROTECTED]> wrote:
> > Tk 8.4 appears to use native Win32 widgets under Cygwin and native
> > WinXP.
>
> It seems to depend on the widget type, and on what you call native... For
> exampl
Ben Finney wrote:
> > I think the colon could be omitted from every type of compound
> > statement: 'if', 'for', 'def', 'class', whatever. Am I missing
> > anything?
>
> A use case. What problem is being solved by introducing this
> inconsistency?
I agree completely. And as a recent convert to Py
Yep, use regular expressions! For example, use the regular expression
r',|\s+' to split on either (a) any amount of whitespace or (b) a
single comma. Try this:
import re
a='1,2,3,4,5 6 7,3,4'
print re.split(r',|\s+*', a)
Matthias Winterland wrote:
> Hi,
>
> I have a simple question. When I read
One other thing I'm wondering: how exactly does Tkinter work? Is the
whole Tk toolkit bound up as library of low-level C code, or does
Tkinter sit on top of a Tcl interpreter?
If the latter, that might explain why it is frustratingly slow on
Cygwin... since Cygwin is not very good at starting up
Wojciech Mula wrote:
> Nick Craig-Wood wrote:
> >> It's very mature, full-featured, and portable, and fairly easy to
> >> learn as well.
> >
> > ...with native look and feel on each platform unlike GTK / TK
>
> AFAIK Tk 8 uses platform's native widgets.
>
> w.
Tk 8.4 appears to use native Win32
John Henry wrote:
> I assume you meant that the example programs looks LabView-like GUIs?
> PythonCard itself has nothing in common with LabView. It's more like
> HyperCard.
That's right, I'm saying the GUIs *produced* by PythonCard look like
those produced by LabView. Believe me, if the Python
Christophe wrote:
> Dan Lenski a écrit :
> > Nick and John S., thank you for the tip on wxPython! I'll look into it
> > for my next project. I too would avoid Qt, not because of the GPL but
> > simply because I don't use KDE under Linux and because Qt is not well
&
Nick Craig-Wood wrote:
> John Salerno <[EMAIL PROTECTED]> wrote:
> > Dan Lenski wrote:
> >
> > > So, is there another toolkit I should be looking at?
> >
> > I highly recommend wxPython.
>
> I'd second that!
>
> There is a book also
>
n quickly move programs to new measurement computers. I like GTK a
lot and Tk is growing on me too.. are there any higher-level "wrapper"
toolkits for GTK and Tk?
Thanks for any advice!
Dan Lenski
University of Maryland
--
http://mail.python.org/mailman/listinfo/python-list
29 matches
Mail list logo