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

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

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: 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. > >

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: 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: 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: 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

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 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

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: 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: 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: 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: 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: 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

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 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

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

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: 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

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

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: 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

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: 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: 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: 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

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: 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 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: 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

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: 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: 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 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: "Correct" db adapter

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

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: 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

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: 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: 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: 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 -

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: 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

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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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

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: 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

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:

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: 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

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 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: 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: 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: 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: 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: 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: Python does not play well with others

2007-02-02 Thread Paul Rubin
"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 because there's no demand or benefit to the > bottom line in doing so. Why should the hosting p

Sybase module 0.38pre2 released

2007-02-02 Thread Sébastien Sablé
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.38pre2.tar.gz The module ho

Re: Ubunu - Linux - Unicode - encoding

2007-02-02 Thread Franz Steinh�usler
On Fri, 2 Feb 2007 00:12:45 +0100, Alan Franzoni <[EMAIL PROTECTED]> wrote: >Il Thu, 01 Feb 2007 20:57:53 +0100, Franz Steinhäusler ha scritto: > >> If I copy files with german umlauts (äöü and strong 's' ß), these >> filenames are not copied properly, and that characters are replaces >> by l

Checking default arguments

2007-02-02 Thread Igor V. Rafienko
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 # the default argument, or user-supplied? foo(1, "bar") => user-sup

[Q] result of os.times() is different with 'time' command

2007-02-02 Thread kwatch
Hi, I have a question about os.times(). os.times() returns a tuple containing user time and system time, but it is not matched to the result of 'time' command. For example, os.times() reports that user time is 39.85 sec, but 'time' command reports that user time is 28.55sec. (machine: Python2.5, M

Timeout for M2Crypto working - patch

2007-02-02 Thread John Nagle
-- http://mail.python.org/mailman/listinfo/python-list

Re: Writing "pythonish" code

2007-02-02 Thread bearophileHUGS
Mizipzor: > To me, the main.py code above looks very ugly. With time, and looking at other people code, you will learn what pythonic means, in the meantime you can remember that into your Python code if you find something that makes you write too much code, or you see something "ugly", then that's

Build Python 2.5 wit VC6.0 ?

2007-02-02 Thread Alexander Eisenhuth
Hi everybody, does somebody have experience in building with VC6.0. On my first try there where missing C-Modules. Is that true. VC6.0 is not supported? Thanks a lot. Regards Alexander PC: What Python version supports VC6.0? -- http://mail.python.org/mailman/listinfo/python-list

Re: compound statement from C "?:"

2007-02-02 Thread bearophileHUGS
Jussi Salmela: > In this particular case you don't need the ternary operator: > print "I saw %d car%s\n" % (n, ("", "s")[n != 1]) The last newline is probably unnecessary. This seems be a bit more readable: print "I saw", n, "car" + ("", "s")[n != 1] With Python 2.5 this looks better: print "I sa

Re: from __future__ import absolute_import ?

2007-02-02 Thread Peter Otten
Peter Otten wrote: > If there are two modules 'foo', one at the toplevel and the other inside a > package 'bar', > > from __future__ import absolute_import > import foo > > will import the toplevel module whereas > > import foo > > will import bar.foo. ... provided these imports are performe

Re: division by 7 efficiently ???

2007-02-02 Thread Nicko
On Feb 1, 8:25 pm, "Krypto" <[EMAIL PROTECTED]> wrote: > The correct answer as told to me by a person is > > (N>>3) + ((N-7*(N>>3))>>3) > > The above term always gives division by 7 No it doesn't. The above term tends towards N * (9/64), with some significant rounding errors. 9/64 is a fairly po

Re: Spring Python 0.2.0 is released

2007-02-02 Thread Jonathan Curran
Greg, You have managed to peak my interest. I'll be dabbling with this in the next few hours. This looks very promising, keep up the good work. - Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: from __future__ import absolute_import ?

2007-02-02 Thread Peter Otten
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 are two modules 'foo', one at

OSS and ALSA

2007-02-02 Thread Silver Rock
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. Is it recommended that one programm using oss becouse of Alsa's OSS compatibility? thanks, claire -- http://ma

Re: asyncore DoS vulnerability

2007-02-02 Thread Jean-Paul Calderone
On Fri, 2 Feb 2007 10:39:57 -0600, [EMAIL PROTECTED] wrote: > >billie> asyncore aims to be a framework, right? I think that when >billie> select() limit is reached asyncore should just drop other >billie> connections. That's all. > >You're asking asyncore to make a policy decision on b

Re: division by 7 efficiently ???

2007-02-02 Thread Nicko
On Feb 2, 4:21 pm, "Bart Ogryczak" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2:00 pm, "Nicko" <[EMAIL PROTECTED]> wrote: > > > precision and the answer that they were looking for was: > > a = (b * 045L) >> 32 > > Note that the constant there is in octal. > > 045L? Shouldn´t it be

Re: Interpreter window

2007-02-02 Thread Gabriel Genellina
"Nils Overas Bergen" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On 2 Feb, 13:07, "skyofdreams" <[EMAIL PROTECTED]> wrote: >> "Nils Overas Bergen" <[EMAIL PROTECTED]> >> [EMAIL PROTECTED] >> >> >I have created a Python application in Windows XP which uses >> > WxWidgets. W

Re: asyncore DoS vulnerability

2007-02-02 Thread skip
billie> asyncore aims to be a framework, right? I think that when billie> select() limit is reached asyncore should just drop other billie> connections. That's all. You're asking asyncore to make a policy decision on behalf the controlling application. It has no idea what that appli

Re: coping directories

2007-02-02 Thread Gabriel Genellina
"Gigs_" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] Gabriel Genellina wrote: > En Thu, 01 Feb 2007 21:33:03 -0300, Gigs_ <[EMAIL PROTECTED]> escribió: > >> class CVisitor(FileVisitor): >> def __init__(self, fromdir, todir): >> self.fromdirLen = len(fromdir) + 1

Re: Sorting a list

2007-02-02 Thread John Salerno
Bruno Desthuilliers wrote: > John Salerno a écrit : > (snip) > >> Oh I didn't sort then reverse, I just replaced sort with reverse. >> Maybe that's why! > > Hmmm... Probably, yes... > > !-) lol, this is what a couple months away from python does to me! -- http://mail.python.org/mailman/listin

Re: division by 7 efficiently ???

2007-02-02 Thread Bart Ogryczak
On Feb 1, 2:00 pm, "Nicko" <[EMAIL PROTECTED]> wrote: > precision and the answer that they were looking for was: > a = (b * 045L) >> 32 > Note that the constant there is in octal. 045L? Shouldn´t it be 044? Or more generally, const = (1<>bitPrecision -- http://mail

Re: stlib name clash when using python as ASP language

2007-02-02 Thread Gabriel Genellina
"Joost" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > When using ASP the iis/inetsrv path is placed as the first item in > sys.path. Consequently importing httplib2 will cause the following > error: > > ImportError: dynamic module does not define init function (initgzip) > >

Re: coping directories

2007-02-02 Thread Gigs_
Jussi Salmela wrote: > Gigs_ kirjoitti: >> hi people >> >> I have problem with this example, not actually the problem, but >> [code] >> class FileVisitor(object): >> def __init__(self, data=None): >> self.context = data >> def run(self, startdir=os.curdir): >> os.path.walk(s

from __future__ import absolute_import ?

2007-02-02 Thread Ron Adam
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 _Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: coping directories

2007-02-02 Thread Jussi Salmela
Gigs_ kirjoitti: > hi people > > I have problem with this example, not actually the problem, but > [code] > class FileVisitor(object): > def __init__(self, data=None): > self.context = data > def run(self, startdir=os.curdir): > os.path.walk(startdir, self.visitor, None) >

Re: asyncore DoS vulnerability

2007-02-02 Thread Chris Mellon
On 2 Feb 2007 07:32:14 -0800, billie <[EMAIL PROTECTED]> wrote: > > This is not a CRASH, It looks an exception with a "Traceback", this is > > the normal way python report problems, nothing wrong with that. > > You can handle it with a try: except: > > I think that such a thing should be handled by

Re: division by 7 efficiently ???

2007-02-02 Thread John Machin
On Feb 3, 2:31 am, "Jesse Chounard" <[EMAIL PROTECTED]> wrote: > On 31 Jan 2007 19:13:14 -0800, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > Its not an homework. I appeared for EA sports interview last month. I > > was asked this question and I got it wrong. I have already fidlled > > aroun

Re: asyncore DoS vulnerability

2007-02-02 Thread billie
> This is not a CRASH, It looks an exception with a "Traceback", this is > the normal way python report problems, nothing wrong with that. > You can handle it with a try: except: I think that such a thing should be handled by asyncore itself. > 512 is probably a fixed limit into XP, win2k3 or win

Re: division by 7 efficiently ???

2007-02-02 Thread John Machin
On Feb 2, 11:03 pm, "Bart Ogryczak" <[EMAIL PROTECTED]> wrote: > On Feb 1, 3:42 am, [EMAIL PROTECTED] wrote: > > > 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

Re: division by 7 efficiently ???

2007-02-02 Thread Jesse Chounard
On 31 Jan 2007 19:13:14 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Its not an homework. I appeared for EA sports interview last month. I > was asked this question and I got it wrong. I have already fidlled > around with the answer but I don't know the correct reasoning behind > it. I th

  1   2   >