Re: Checking default arguments

2007-02-02 Thread Neil Cerutti
On 2007-02-02, Igor V. Rafienko <[EMAIL PROTECTED]> wrote: > Hi, > > I was wondering whether it was possible to find out which > parameter value is being used: the default argument or the > user-supplied one. That is: > > def foo(x, y="bar"): > # how to figure out whether the value of y is >

Re: Checking default arguments

2007-02-02 Thread Steven Bethard
Igor V. Rafienko wrote: > I was wondering whether it was possible to find out which parameter > value is being used: the default argument or the user-supplied one. > That is: > > def foo(x, y="bar"): > # how to figure out whether the value of y is > # the default argument, or user-suppl

Re: OSS and ALSA

2007-02-02 Thread Chris Lambacher
On Fri, Feb 02, 2007 at 12:08:22AM -0200, Silver Rock wrote: >Hi all, > >I've seen that python comes by default with a module for communication >with OSS. > >I've looked for a ALSA module too (pyalsa) but it seems to handle only >limited operations. how about http://sourceforg

Re: Tkinter Scrolling

2007-02-02 Thread D
> Here you are: > > --- > from Tkinter import * > > ## Main window > root = Tk() > ## Grid sizing behavior in window > root.grid_rowconfigure(0, weight=1) > root.grid_columnconfigure(0, weight=1) > ## Canvas > cnv = Canvas(root) > cnv.grid(ro

Re: Python does not play well with others

2007-02-02 Thread Chris Mellon
On 02 Feb 2007 11:10:04 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > > If the hosting provider doesn't want to install MySQLdb then it may > > not be a technical issue - perhaps they just can't be bothered to > > install it, possibly becaus

Re: Python does not play well with others

2007-02-02 Thread Paul Rubin
"Chris Mellon" <[EMAIL PROTECTED]> writes: > How about because thats what you pay them for? Seriously. Do you even > think about what you're saying? Python needs to move MySQL (and only > MySQL, of course) into the core because installing packages is too > much of a burden for hosting companies? W

Re: imaplib : error reporting use 'randomly' exception or return value

2007-02-02 Thread aspineux
I looked carefully imaplib.py and wrote this version of _simple_command that take care of the way the function is used by other to keep the same functionality class bye(imaplib.IMAP4.abort): pass class bad(imaplib.IMAP4.abort): pass def _simple_command(self, name, *args): ty

Re: Python does not play well with others

2007-02-02 Thread Chris Mellon
On 02 Feb 2007 11:41:03 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > How about because thats what you pay them for? Seriously. Do you even > > think about what you're saying? Python needs to move MySQL (and only > > MySQL, of course) int

more examples on lamba

2007-02-02 Thread David Bear
I've been going through David Mertz's python book and he is heavy in to lamba's and higher order functions. This is all very new to me. Can anyone point me to more web stuff that describes more deeply lamba's and making high order functions -- functional programming styles. Coming from BASIC an

Re: more examples on lamba

2007-02-02 Thread Paul Rubin
David Bear <[EMAIL PROTECTED]> writes: > Can anyone point me to more web stuff that describes more deeply > lamba's and making high order functions -- functional programming > styles. I suggest Abelson and Sussman's book Structure and Interpretation of Computer Programs. The text is online here:

Re: result of os.times() is different with 'time' command

2007-02-02 Thread aspineux
I dont see anything wrong ! Did you try to measure time with your watch ? Did you try a simple python test.py without the time command ? Maybe python is 'disturbed' by the intel core Here my result on a linux dual AMD, python 2.4.3 # time python test.py n=35, v=14930352 utime=22.54, stime=0.02

Is Python Right for Me?

2007-02-02 Thread Mister Newbie
I want to make small, 2D games. I have no programming experience. Is Python a good choice? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fixed length lists from .split()?

2007-02-02 Thread George Sakkis
On Feb 1, 2:40 pm, Bob Greschke <[EMAIL PROTECTED]> wrote: > This idiom is what I ended up using (a lot it turns out!): > > Parts = Line.split(";") > Parts += (x-len(Parts))*[""] > > where x knows how long the line should be. If the line already has > more parts than x (i.e. [""] gets multiplied

Re: from __future__ import absolute_import ?

2007-02-02 Thread Ron Adam
Peter Otten wrote: > Ron Adam wrote: > >> from __future__ import absolute_import >> >> Is there a way to check if this is working? I get the same results with >> or without it. >> >> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) >> [MSC v.1310 32 bit (Intel)] on win 32 > > If there a

Re: Is Python Right for Me?

2007-02-02 Thread Terry Reedy
"Mister Newbie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I want to make small, 2D games. I have no programming experience. Is Python | a good choice? Possibly. There is an add-on package called pygame that is, I believe, 2d oriented. See www.pygame.org There is also an as

Re: Is Python Right for Me?

2007-02-02 Thread Mister Newbie
"Terry Reedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > "Mister Newbie" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >|I want to make small, 2D games. I have no programming experience. Is > Python >| a good choice? > > Possibly. There is an add-on package call

Re: Python does not play well with others

2007-02-02 Thread George Sakkis
On Feb 2, 2:41 pm, Paul Rubin wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > How about because thats what you pay them for? Seriously. Do you even > > think about what you're saying? Python needs to move MySQL (and only > > MySQL, of course) into the core becaus

Where Does One Begin?

2007-02-02 Thread Mister Newbie
I have no programming experience. I want to learn Python so I can make simple, 2D games. Where should I start? Can you recommend a good book? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where Does One Begin?

2007-02-02 Thread hg
Mister Newbie wrote: > I have no programming experience. I want to learn Python so I can make > simple, 2D games. Where should I start? Can you recommend a good book? > > Thank you. http://www.diveintopython.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread James Stroud
ardief wrote: > Hi everyone > Here is my problem: > I have a list that looks like this - > [['a', '13'], ['a', '3'], ['b', '6'], ['c', '12'], ['c', '15'], ['c', > '4'], ['d', '2'], ['e', '11'], ['e', '5'], ['e', '16'], ['e', '7']] > > and I would like to end up with something like this, i.e. with

Re: Checking default arguments

2007-02-02 Thread Gabriel Genellina
En Fri, 02 Feb 2007 15:30:53 -0300, Igor V. Rafienko <[EMAIL PROTECTED]> escribió: >> I was wondering whether it was possible to find out which parameter > value is being used: the default argument or the user-supplied one. > That is: > > def foo(x, y="bar"): > # how to figure out whether th

Re: division by 7 efficiently ???

2007-02-02 Thread Garrick . Peterson
>How to divide a number by 7 efficiently without using - or / operator. >We can use the bit operators. I was thinking about bit shift operator >but I don't know the correct answer. It may not be efficient, but the easiest solution (without using tricks from a particular languages) is to increment

Re: Python does not play well with others

2007-02-02 Thread skip
Paul> Why should the hosting provider need to devote attention to Paul> something like that? MySQLdb or something like it should be Paul> included with Python, ... What about Firebird? Oracle? Sybase? Who maintains them in the core? MySQLdb is quite stable outside the core. What

Re: Python does not play well with others

2007-02-02 Thread skip
Paul> What does "batteries included" mean to you? To me, it means you Paul> don't have to install add-ons. Who decides which batteries are important to include? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: asyncore DoS vulnerability

2007-02-02 Thread paul
Jean-Paul Calderone schrieb: > It could ask the application. On the other hand, maybe asyncore remains in > a perfectly consistent state even after it raises this exception, and it is > already "asking" by letting this exception propagate up: if the application > is free to start the loop again af

Re: parent-child object design question

2007-02-02 Thread manstey
Hi, There was a mistake above, and then I'll explain what we're doing: >>> insCacheClass = CacheClass(oref) >>> insCacheProperty = CacheProperty(insOref,'Chapter') should have been >>> insCacheClass = CacheClass(oref) >>> insCacheProperty = CacheProperty(insCacheClass ,'Chapter') Now, to answer

what are you using python language for?

2007-02-02 Thread Brian Epstein
Brian Y. Epstein, Esq. Belkin Burden Wenig & Goldman LLP 270 Madison Avenue New York, New York 10016 Bus: (212) 867-4466 (x363) Fax: (212) 867-0709 [EMAIL PROTECTED] -- This message contains inf

Re: Spring Python 0.2.0 is released

2007-02-02 Thread gregturn
I have managed to update the site documentation on ApplicationSecurity (the newer module in this release). Took me awhile, and one time I accidentally browsed to another site and lost what I had started. Well, it is in there now at http://springpython.python-hosting.com/wiki/ApplicationSecurity -

Re: Where Does One Begin?

2007-02-02 Thread John Nagle
Mister Newbie wrote: > I have no programming experience. I want to learn Python so I can make > simple, 2D games. Where should I start? Can you recommend a good book? > > Thank you. Blender GameKit. John Nagle -- http://mail.python.org/mailman/list

Re: Python does not play well with others

2007-02-02 Thread Paul Rubin
"George Sakkis" <[EMAIL PROTECTED]> writes: > > What does "batteries included" mean to you? To me, it means you don't > > have to install add-ons. > > So let's make a 500MB executable and add Numpy, Zope, Django, PIL, > pretty much everything actually. Even better, make CheeseShop just a > fronte

Re: Python does not play well with others

2007-02-02 Thread Paul Rubin
[EMAIL PROTECTED] writes: > database: Sybase, Oracle, MySQL, SQLite, ODBC, Firebird > database versions: who knows? assume two per database > python versions: 2.4, 2.5, 2.6, 3.0? > platforms: windows, pick two linux flavors, solaris > > Those numbers give me 6 * 2 * 4 * 4 == 192 co

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread bearophileHUGS
Paddy: >>> _ = [d[x0].append(x1) for x0,x1 in data] I think that you probably want: for text, num in data: d[text].append(num) ardief: > thanks to everyone for the help, and the speed of it! It's really > useful and I will spend some time working on understanding the code > you posted. I'd be s

working model of a microcoded computer

2007-02-02 Thread tom arnall
This is somewhat off topic, but I think many programmers would be interested to look at a working model of a microcoded computer at:         tomspages.com         click on the link for 'Hack the Com puter Model.' It conveys among other things the physical events that underlie execution of a micr

Re: "Correct" db adapter

2007-02-02 Thread king kikapu
Thank you all! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-02 Thread Diez B. Roggisch
> I do think the core should have more stuff than it does, so that its > functionality can be on a par with competing language distros like > J2SE and PHP. Both of those distros include database connectvity > modules and web frameworks. This is simply not true. J2SE doesn't include a web-framewo

Re: Python does not play well with others

2007-02-02 Thread skip
Paul> Numpy should certainly be included and I think there are efforts Paul> in that direction. There is also a movement to choose a web Paul> framework to include and Django might be a good choice. Right off the bat you run into problems. While Numpy is popular in the scientific

Re: Python does not play well with others

2007-02-02 Thread skip
Paul> Why is it that PHP and J2SE manage deal with this problem but Paul> Python cannot? I can't speak authoritatively for either PHP or J2SE, but I suspect the latter at least has some signifiant monetary support (if not outright gobs of human resources) from Sun. PHP seems to have a mo

Re: Overloading the tilde operator?

2007-02-02 Thread greg
James Stroud wrote: > You haven't addressed why the limitation isn't arbitrary. It's not arbitrary because there is a built-in meaning for infix minus, but not for infix tilde. Python doesn't go out of its way to provide operators which aren't used by at least one built-in type. -- Greg -- htt

Re: Where Does One Begin?

2007-02-02 Thread Jonathan Curran
Hey n00b :) If you want to start 2d game programming w/python, I would look at the package pygame. There are some intro. tutorials at http://www.pygame.org/wiki/tutorials. These should give you a head start. Besides that, I suggest you scour the web via google to look at the source of simple 2

How much introspection is implementation dependent?

2007-02-02 Thread James Stroud
Hello, I wanted to automagically generate an instance of a class from a dictionary--which might be generated from yaml or json. I came up with this: # automagical constructor def construct(cls, adict): dflts = cls.__init__.im_func.func_defaults vnames = cls.__init__.im_func.func_code.co_v

Re: Spring Python 0.2.0 is released

2007-02-02 Thread greg
Jonathan Curran wrote: > Greg, > You have managed to peak my interest. I think the word you're after here is "pique" (although I suppose "peak" kind of makes sense as well:-). -- Greg (a different one) -- http://mail.python.org/mailman/listinfo/python-list

how to merge strings to a line

2007-02-02 Thread andy king
Hello, I have a file that contains the following: my name is larry is in 10th grade got A+ in math my name is john is in 10th grade got A+ in english my name is peter [...] i need to convert the file to look like: my name is larry my name is larry is in 10th grade --> (my name is larr

Re: Where Does One Begin?

2007-02-02 Thread Michael
Mister Newbie wrote: > I have no programming experience. I want to learn Python so I can make > simple, 2D games. Where should I start? Can you recommend a good book? If that's your goal, there's a perfect book for you - it's called "Python for the Absolute Beginner". It focusses on people with n

Re: Is Python Right for Me?

2007-02-02 Thread [EMAIL PROTECTED]
On Feb 2, 2:26 pm, Mister Newbie <[EMAIL PROTECTED]> wrote: > "Terry Reedy" <[EMAIL PROTECTED]> wrote innews:[EMAIL PROTECTED]: > > > > > > > > > "Mister Newbie" <[EMAIL PROTECTED]> wrote in message > >news:[EMAIL PROTECTED] > >|I want to make small, 2D games. I have no programming experience. Is >

Re: How much introspection is implementation dependent?

2007-02-02 Thread George Sakkis
On Feb 2, 6:56 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Hello, > > I wanted to automagically generate an instance of a class from a > dictionary--which might be generated from yaml or json. I came up with this: > > (snip) > > == > > #! /usr/bin/env python > > # automagical constructor > def c

Re: Where Does One Begin?

2007-02-02 Thread George Sakkis
On Feb 2, 3:39 pm, Mister Newbie <[EMAIL PROTECTED]> wrote: > I have no programming experience. I want to learn Python so I can make > simple, 2D games. Where should I start? Can you recommend a good book? > > Thank you. http://www.amazon.com/Game-Programming-Python-Development/dp/1584502584 --

Re: What happened to SPE?

2007-02-02 Thread Jaroslaw Zabiello
Dnia 11 Jan 2007 17:02:49 +0100, Neil Cerutti napisał(a): > SPE lost its web host, and last I heard is looking for a new > home. For now you can get it here: > > http://sourceforge.net/projects/spe/ That is old addres. Never is http://developer.berlios.de/projects/python/ -- Jaroslaw Zabiel

Numeric and PIL Files?

2007-02-02 Thread W. Watson
I'm looking at some files that are related to Python: Python-2.4.2.msi Numeric-24.2.win32-py2.4.exe PIL-1.1.5.win32-py2.4.exe What are the three files? msi is the install file for MS, but what are the other two, and where can I find them? The first one no longer seems available on the

Re: Numeric and PIL Files?

2007-02-02 Thread Gabriel Genellina
En Sat, 03 Feb 2007 00:03:09 -0300, W. Watson <[EMAIL PROTECTED]> escribió: > I'm looking at some files that are related to Python: > > Python-2.4.2.msi This is the Windows installer for Python 2.4.2; you should instead use the 2.4.4 version (last one on the 2.4 series). There should be no

Re: result of os.times() is different with 'time' command

2007-02-02 Thread Douglas Wells
[various posting problems corrected and response interspersed in previous post for purposes of coherent response] In article <[EMAIL PROTECTED]>, "aspineux" <[EMAIL PROTECTED]> writes: > On 2 Feb, 19:30, [EMAIL PROTECTED] wrote: > > Hi, > > > > I have a question about os.times(). > > os.times() re

from... import...

2007-02-02 Thread fatwallet961
what's the from ... import keyword use for? for example - from contenttype import getContentType import os import sys import getopt import types import re import pprint import logging from contenttype import getContentType In Java what kind of statement is similar this? thanks -- http://mail.py

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Paddy
On Feb 2, 10:34 pm, [EMAIL PROTECTED] wrote: > Paddy: > > >>> _ = [d[x0].append(x1) for x0,x1 in data] Yep, definitely a case of overdoing the list comprehensions when you throw away the list. I'll watch out for that in the future, Ta. - Paddy. > > I think that you probably want: > > for text, n

Re: from... import...

2007-02-02 Thread Stargaming
[EMAIL PROTECTED] schrieb: > what's the from ... import keyword use for? > for example - from contenttype import getContentType > > import os > import sys > import getopt > import types > import re > import pprint > import logging > from contenttype import getContentType > > In Java what kind of

main

2007-02-02 Thread fatwallet961
is the main function in python is exact compare to Java main method? all execution start in main which may takes arguments? like the follow example script - def main(argv): == and what is __name__ __main__ use for in terms of Java? thanks

Re: from... import...

2007-02-02 Thread Paddy
On Feb 3, 4:12 am, [EMAIL PROTECTED] wrote: > what's the from ... import keyword use for? > for example - from contenttype import getContentType > > import os > import sys > import getopt > import types > import re > import pprint > import logging > from contenttype import getContentType > > In Jav

Re: Python does not play well with others

2007-02-02 Thread Ben Finney
Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes: > Why should the hosting provider need to devote attention to > something like that? MySQLdb or something like it should be > included with Python, not added separately by the hosting provider. "Something like it" *is* included in Python. Pytho

Re: Checking default arguments

2007-02-02 Thread Ben Finney
[EMAIL PROTECTED] (Igor V. Rafienko) writes: > I was wondering whether it was possible to find out which parameter > value is being used: the default argument or the user-supplied one. > That is: > > def foo(x, y="bar"): > # how to figure out whether the value of y is > # the default argu

Re: What is the Decisive "Clash" of Our Time?

2007-02-02 Thread stj911
Forget about the lunacy ... just enjoy these fun movies that are also on optics education. You can also save them by right clicking the links and saving them as flv files and download a free flv player. google is your friend. "Bush Administration Insider Says U.S. Government Behind 911.flv" "http:

Re: from... import...

2007-02-02 Thread Ben Finney
[EMAIL PROTECTED] writes: > what's the from ... import keyword use for? > for example - from contenttype import getContentType > > import os > import sys > import getopt > import types > import re > import pprint > import logging > from contenttype import getContentType The program now can access

Re: main

2007-02-02 Thread Paddy
On Feb 3, 4:45 am, [EMAIL PROTECTED] wrote: > is the main function in python is exact compare to Java main method? > > all execution start in main which may takes arguments? > Hi Fatwallet, May I have some of your money? Oh, sorry, the main function... The main function is *not* like that of J

Re: Python does not play well with others

2007-02-02 Thread Paul Rubin
Ben Finney <[EMAIL PROTECTED]> writes: > "Something like it" *is* included in Python. Python 2.5 includes > SQLite in the standard library. Where do we draw the line? You want > MySQL, I want PostgreSQL, he wants Firebird, they want an interface to > something proprietary. Since Python is being to

python bracket

2007-02-02 Thread fatwallet961
there is no bracket in python how can i know where a loop or a function ends? -- http://mail.python.org/mailman/listinfo/python-list

Re: python bracket

2007-02-02 Thread Olexandr Melnyk
By indentation: def some_function(): a = 10 print a print b # this statement doesn't belong to the function above - Olexandr Melnyk, http://omelnyk.net/ 2007/2/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: there is no bracket in python how can i know where a lo

Re: python bracket

2007-02-02 Thread Paddy
On Feb 3, 5:48 am, [EMAIL PROTECTED] wrote: > there is no bracket in python > > how can i know where a loop or a function ends? Hi fatwallet, Please, please, please, peruse the following: http://wiki.python.org/moin/BeginnersGuide There is lots in their to get you started and up-and-running in P

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-02 Thread stj911
> >>Can a jet fuel/hydrocarbon fire collapse a steel structure? An > >>experiment. > > > [snip] > > Run your "experiment" again but add some pure oxygen such as was > > escaping from the on-board breathing oxygen tanks on the > > airplanes that were crashed into the WTC. No need to do it. We have

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-02 Thread John Barrett
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> >>Can a jet fuel/hydrocarbon fire collapse a steel structure? An >> >>experiment. >> >> > [snip] >> > Run your "experiment" again but add some pure oxygen such as was >> > escaping from the on-board breathing oxygen tanks on the >> >

Re: Where Does One Begin?

2007-02-02 Thread [EMAIL PROTECTED]
On Feb 2, 4:34 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Mister Newbie wrote: > > I have no programming experience. I want to learn Python so I can make > > simple, 2D games. Where should I start? Can you recommend a good book? > > > Thank you. > > Blender GameKit. > >

using numpy to do linear algebra

2007-02-02 Thread Michael O'Brien
Hola~ I have a large array of points (over a million). I would like to multiply each point in the array by a 4x4 matrix. I keep thinking there should be an easy way to do this using numpy, but I can't figure out the mojo to do it. Is that possible? MO -- http://mail.python.org/mailman/listinfo/

Re: using numpy to do linear algebra

2007-02-02 Thread Robert Kern
Michael O'Brien wrote: > Hola~ > > I have a large array of points (over a million). I would like to > multiply each point in the array by a 4x4 matrix. I keep thinking > there should be an easy way to do this using numpy, but I can't figure > out the mojo to do it. Is that possible? numpy questio

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-02 Thread stj911
On Feb 2, 10:32 pm, "John Barrett" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > >> > [snip] > >> > Run your "experiment" again but add some pure oxygen such as was > >> > escaping from the on-board breathing oxygen tanks on the > >> > airplanes that were crashed into the WT

<    1   2