Using unittest for benchmarking / speed improvements

2008-03-29 Thread Daniel Abel
Hi! As everyone knows, using unittests to monitor and improve the correctness of code is really handy. Is there a good system for using unittests to monitor / improve the _speed_ of code? I.e. I would like a system which every time when running a test, also measures the time the test took, and st

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Hrvoje Niksic
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> systems. (In theory, file input/output should also be available as >> asynchronous code, but async IO is low-level and not available in >> Python.) While threads shouldn't be considered a replacement for > > I suggest you tell that the twisted-gu

Re: How do I reconnect a disconnected socket?

2008-03-29 Thread Bryan Olson
Grant Edwards wrote: > Laszlo Nagy wrote: >> What about non-blocking sockets? > > $ man recv > ... >If no messages are available at the socket, the receive >calls wait for a message to arrive, unless the socket is >non-blocking (see fcntl(2)), in which case the value -1 >

Re: Setting the value of one cell in QTableWidget fills everything.

2008-03-29 Thread Constantly Distracted
> Move the creation of the QTableWidgetItem() to the inner loop (and call > it "item" rather than "items"). > > Phil Thanks, that works perfectly. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tell ya' what:

2008-03-29 Thread castironpi
On Mar 28, 3:59 pm, [EMAIL PROTECTED] wrote: > I want to regression a signal.  It's NN, not necessarily, sine wave. > What kind of numbers of harmonic simultaneous sounds are we looking > at?  How close to an A 440 can a human make? > > I want recognition to alert me.  As a sine wave is coming in:

Re: finding euclidean distance,better code?

2008-03-29 Thread Roel Schroeven
Steven D'Aprano schreef: > On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote: > >> Gabriel Genellina wrote: >>> That's what I said in another paragraph. "sum of coordinates" is using >>> a different distance definition; it's the way you measure distance in a >>> city with square blocks. I don

Re: Help me on function definition

2008-03-29 Thread Roel Schroeven
aeneng schreef: > Hello everyone, > > I am just starting to use python in numerical cacluation. > I need you to help me to see what's wrong with the following piece of > codes, which computes the cross product of two vectors and returns > the result. u and v are two 3x1 matrix. > > when I impo

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Paul Rubin
Hrvoje Niksic <[EMAIL PROTECTED]> writes: > Note that I said "*file* input/output". Twisted and asyncore are > about asynchronous socket programming that polls over nonblocking file > descriptors such as found in socket programming, not about wrapping > aio(3) and the equivalent Windows APIs. aio

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Paul Rubin
Paul Rubin writes: > aio is also used for sockets, while twisted and asyncore use select or > something similar. That is asynchronous but in a different sense of > the word. See also: http://www.kegel.com/c10k.html Hmm that actually says that in Linux 2.6.0#-test2 sock

Re: finding euclidean distance,better code?

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 10:11:28 +0100, Roel Schroeven wrote: > Steven D'Aprano schreef: >> On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote: >> >>> Gabriel Genellina wrote: That's what I said in another paragraph. "sum of coordinates" is using a different distance definition; it's th

Passing function objects to timeit

2008-03-29 Thread Steven D'Aprano
The timeit.Timer class times "code snippets" -- you pass it strings rather than function objects. That's good for what it's worth, but sometimes the code you want to time is too big to easily pass as a string, or maybe you only have access to a function object without the source, or for whateve

Why prefer != over <> for Python 3.0?

2008-03-29 Thread kwitters
I don't know if this is the right place to discuss the death of <> in Python 3.0, or if there have been any meaningful discussions posted before (hard to search google with '<>' keyword), but why would anyone prefer the comparison operator != over <>??? I've written an article about it to try and

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I don't know if this is the right place to discuss the death of <> in > Python 3.0, or if there have been any meaningful discussions posted > before (hard to search google with '<>' keyword), but why would anyone > prefer the comparison operator != over <>??? I doubt an

deleting a line from a file

2008-03-29 Thread eMko
Hello, In Perl, using a Tie::File module I can easily and comfortably delete a line from the middle of a text file: my @file; open(DATA, "+<:encoding(utf8):raw" , "file.txt") or return 0; tie @file, 'Tie::File', \*DATA or return 0; splice(@file, $_[0], 1); untie @file; close DATA; (w

Re; finding euclidean distance,better code?

2008-03-29 Thread Hendrik van Rooyen
On Saturday 29 March 2008 03:09:46 Steven D'Aprano wrote: > On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote: > > Gabriel Genellina wrote: > >> That's what I said in another paragraph. "sum of coordinates" is using > >> a different distance definition; it's the way you measure distance in a >

Re: why does socket.makefile require non-blocking mode?

2008-03-29 Thread Guilherme Polo
2008/3/28, Forest <[EMAIL PROTECTED]>: > The socket.makefile() docs say, "the socket must be in blocking mode." I > don't see any explanation of why blocking mode is required, and I'm not sure > whether that means timeout mode is forbidden as well. Can someone clarify > this? > Have you set y

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 04:08:16 -0700, Paul Rubin wrote: > [EMAIL PROTECTED] writes: >> I don't know if this is the right place to discuss the death of <> in >> Python 3.0, or if there have been any meaningful discussions posted >> before (hard to search google with '<>' keyword), but why would anyon

Re: deleting a line from a file

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 04:13:10 -0700, eMko wrote: > Is there some easy way how to delete a line from a middle of a file in > Python? If the file is small enough to fit into memory (say, up to a few hundred megabytes on most modern PCs): lines = open('file', 'r').readlines() del line[100] open('f

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > reserve <> for "greater than or less than but not equal to" which is > subtly different. (Think about unordered values, where x != y does not > imply that x < y or x > y, e.g. IEEE NaNs.) Heh, good point. > > The scary choice is /= which can be inte

Re: deleting a line from a file

2008-03-29 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > The only safe way to delete a line from a file (at least under common > operating systems like Windows, Linux and Mac) is to copy the file > (without the line you wish to delete) to a temporary file, then replace > the original file with the new vers

Re: finding euclidean distance,better code?

2008-03-29 Thread Roel Schroeven
Steven D'Aprano schreef: > On Sat, 29 Mar 2008 10:11:28 +0100, Roel Schroeven wrote: > >> Steven D'Aprano schreef: >>> On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote: >>> Gabriel Genellina wrote: > That's what I said in another paragraph. "sum of coordinates" is > using a diff

Re: Re; finding euclidean distance,better code?

2008-03-29 Thread Maurice LING
Hendrik van Rooyen wrote: > On Saturday 29 March 2008 03:09:46 Steven D'Aprano wrote: >> On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote: >>> Gabriel Genellina wrote: That's what I said in another paragraph. "sum of coordinates" is using a different distance definition; it's the wa

Create executable from executable with py2exe

2008-03-29 Thread vedrandekovic
Hello, Is there any example how can I create executable from executable with py2exe.For example if I create main executable with some TextEntry ( wxpython ) and then when i write this code into this entry: import os print os.getcwd() print "ok" ...to main executable convert this code into execut

Re: Psyco alternative

2008-03-29 Thread king kikapu
On 28 Μαρ, 20:06, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 27 Mar, 15:19, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > [Psyco maintenance and further development] > > > Nope, but I heard through the grapevine that while it won't be supported for > > all times to come, a new version is i

Re: finding euclidean distance,better code?

2008-03-29 Thread Gerard Flanagan
On Mar 29, 11:01 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 29 Mar 2008 10:11:28 +0100, Roel Schroeven wrote: > > Steven D'Aprano schreef: > >> On Fri, 28 Mar 2008 16:59:59 +0100, Robert Bossy wrote: > > >>> Gabriel Genellina wrote: > That's what I said in anot

Re: finding euclidean distance,better code?

2008-03-29 Thread Peter Otten
Steven D'Aprano wrote: > Wikipedia doesn't believe that M-D is the primary or most common name, > and the link you give redirects to "Taxicab distance". Googlefight > agrees: "Taxicab distance" is more than twice as common, and "rectilinear > distance" more than five times as common. Could it be

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Diez B. Roggisch
Hrvoje Niksic schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >>> systems. (In theory, file input/output should also be available as >>> asynchronous code, but async IO is low-level and not available in >>> Python.) While threads shouldn't be considered a replacement for >> I suggest

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Diez B. Roggisch
> I appreciate the droll sense of humor, but do you mean to > assert that asyncore.py supports asynchronous disk file I/O? As I said in an answer to the OP, I somewhat glossed over the "file" and just read IO. And under Posix, python *does* support asynchronous IO using the select-module. If you

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Diez B. Roggisch
Paul Rubin schrieb: > Hrvoje Niksic <[EMAIL PROTECTED]> writes: >> Note that I said "*file* input/output". Twisted and asyncore are >> about asynchronous socket programming that polls over nonblocking file >> descriptors such as found in socket programming, not about wrapping >> aio(3) and the equ

Re: finding euclidean distance,better code?

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 13:06:27 +0100, Roel Schroeven wrote: > In any case, I replied because your reaction didn't feel all that gentle > to me; to be honest, it felt rather rude. Are you new to Usenet? :-) No offense taken; I hope Robert didn't take offense either, but took the little dig in the

Re: Psyco alternative

2008-03-29 Thread Luis M . González
On 27 mar, 13:14, king kikapu <[EMAIL PROTECTED]> wrote: > > One reason attention is going to PyPy instead of Psyco... > > > Jean-Paul > > I had a look at PyPy, it, indeed, have a very long way to go so we can > consider it an alternative. To see how it´s going, you can check this out: http://more

[OT] Modesty and apologies [Re: Re; finding euclidean distance,better code?]

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 12:43:22 +0200, Hendrik van Rooyen wrote: > Sorry about having to dispel your illusions, but - [...] > Have you noticed that when people say "Sorry.but" they are not > normally sorry at all? Heh heh heh. Reminds me of a quote from the character Spike of "Buffy the Vam

Python and xml

2008-03-29 Thread Doran, Harold
I am a python neophyte who has used python to parse through text files using basic functions and no OOP experience. I have a need to process some xml files and from what I am now reading python is the exact tool I need to work through this issue. However, as I read online docs and peruse which

Re: Help me on function definition

2008-03-29 Thread castironpi
On Mar 29, 4:18 am, Roel Schroeven <[EMAIL PROTECTED]> wrote: > aeneng schreef: > > > > > > > Hello everyone, > > > I am just starting to use python in numerical cacluation. > > I need you to help me to see what's wrong with the following piece of > > codes, which computes the cross product of two

ANN: python-ldap-2.3.4

2008-03-29 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g.

Re: Psyco alternative

2008-03-29 Thread king kikapu
On 29 Μαρ, 16:03, Luis M. González <[EMAIL PROTECTED]> wrote: > On 27 mar, 13:14, king kikapu <[EMAIL PROTECTED]> wrote: > > > > One reason attention is going to PyPy instead of Psyco... > > > > Jean-Paul > > > I had a look at PyPy, it, indeed, have a very long way to go so we can > > consider it a

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > I appreciate the droll sense of humor, but do you mean to > > assert that asyncore.py supports asynchronous disk file I/O? > > As I said in an answer to the OP, I somewhat glossed over the "file" > and just read IO. And under Posix, python *does*

Re: Summary of threading for experienced non-Python programmers?

2008-03-29 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > In which sense is that different? AFAIK select lets you avoid polling > and provides notifications (possibly with timeouts) for IO-events. So > where exactly is the difference? I read TFA, and it does mention that > select/poll have potential for opt

Re: Finding Full Path to Process EXE

2008-03-29 Thread misceverything
On Mar 28, 4:53 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > I would like to write a script that would enumerate all running > > processes and return the full path to the EXE of each running > > process. However, I can't seem to find any good info on how to

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Jeroen Ruigrok van der Werven
-On [20080329 13:01], Paul Rubin ("http://phr.cx"@NOSPAM.invalid) wrote: >Yes, what I mean is that some languages (e.g. Ada, Haskell) use /= for >nonequality. /= is understandable given how it looks like a digraph for ≠ (U+2260) and I am guessing that was the intent. -- Jeroen

Problem with sqlite

2008-03-29 Thread aiwarrior
class db: def __init__(self): #constructor conn = sqlite3.connect('./db.db') conn.isolation_level = None self.cursor = conn.cursor() try: self.cursor.execute("CREATE TABLE database (album,filepath)" ) except: pass def add_entr

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Lie
On Mar 29, 5:55 pm, [EMAIL PROTECTED] wrote: > I don't know if this is the right place to discuss the death of <> in > Python 3.0, or if there have been any meaningful discussions posted > before (hard to search google with '<>' keyword), but why would anyone > prefer the comparison operator != ove

Re: deleting a line from a file

2008-03-29 Thread Paddy
On Mar 29, 11:13 am, eMko <[EMAIL PROTECTED]> wrote: > Hello, > > In Perl, using a Tie::File module I can easily and comfortably delete > a line from the middle of a text file: > > my @file; > open(DATA, "+<:encoding(utf8):raw" , "file.txt") or return 0; > tie @file, 'Tie::File', \*DATA or re

Re: Problem with sqlite

2008-03-29 Thread Duncan Booth
aiwarrior <[EMAIL PROTECTED]> wrote: > When i execute this the database doesn't get filled with anything and > the program stays running in memory for ever. That's odd, when I execute the code you posted I just get "NameError: global name 'sqlite3' is not defined". You should always try to post

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Duncan Booth
Lie <[EMAIL PROTECTED]> wrote: > You're forcing your argument too much, both != and <> are NOT standard > mathematics operators -- the standard not-equal operator is >< -- and > I can assure you that both != and <> won't be comprehensible to non- > programmers. My maths may be a bit rusty, but I

Licensing

2008-03-29 Thread DS
I'm pretty sure this is the wrong place to ask, but I'm hoping someone will point me in the right direction. I'm getting ready to publish a first open-source project written in python. I am planning to use GPLas the license. However, in my code, there is a function that I like from Python Coo

Re: Problem with sqlite

2008-03-29 Thread Gerhard Häring
Ok, I'll review your code. aiwarrior wrote: > class db: > def __init__(self): #constructor > conn = sqlite3.connect('./db.db') > conn.isolation_level = None Autocommit mode is mostly for newbies who forget to call commit. Unfortunately, newbiews find enough other ways to shoot

problem with logic in reading a binary file

2008-03-29 Thread [EMAIL PROTECTED]
Hello, I am having trouble writing the code to read a binary string. I would like to extract the values for use in a calculation. Any help would be great. Here is my function that takes in a string. def parseSequence(data, start): group_num = data[start:start+2] element_num = data[sta

Re: How to insert multiple rows in SQLite Dbase

2008-03-29 Thread Gerhard Häring
Gabriel Genellina wrote: > [...] > and execute: > cur.executemany("insert into log (IP, EntryDate, Requestt, ErrorCode) > values (:ip, :date, :request, :errorcode)", values) It's probably worth mentioning that pysqlite's executemany() accepts anything iterable for its parameter. So you don't need

Re: problem with logic in reading a binary file

2008-03-29 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Hello, > > I am having trouble writing the code to read a binary string. I would > like to extract the values for use in a calculation. > > Any help would be great. > Without having looked at your code an any detail, may I humbly suggest that you throw it all out an

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Lie
On Mar 30, 1:24 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Lie <[EMAIL PROTECTED]> wrote: > > You're forcing your argument too much, both != and <> are NOT standard > > mathematics operators -- the standard not-equal operator is >< -- and > > I can assure you that both != and <> won't be compreh

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Michael Wieher
to me it seems simple. C uses != why does C use != because its kind of hard to type the "equal with a slash" so if python is supposed to be a simple and easy to use language, use the simple and easy to understand, standard 'not-equal' operator... Idk, maybe there's more to it but simple is

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Carl Banks
On Mar 29, 6:55 am, [EMAIL PROTECTED] wrote: > why would anyone Questions that begin with the words "why would anyone" are almost always betray an arrogance about their own beliefs and an ignorance (or feigning ignorance) of human nature. Wiser folks know better than to phrase this question so ju

Problem with python

2008-03-29 Thread mac_the_scotte
Hi there. I downloaded python a couple of days ago from the official site and have started writing simple programs in the python gui (this being my first attempt at programming ever). The only thing is when I write python code in a text editor and save it as a .py file, when I double click it all t

Re: Problem with python

2008-03-29 Thread Lie
On Mar 30, 2:57 am, [EMAIL PROTECTED] wrote: > Hi there. > I downloaded python a couple of days ago from the official site and > have started writing simple programs in the python gui (this being my > first attempt at programming ever). The only thing is when I write > python code in a text editor

Re: Help me on function definition

2008-03-29 Thread Terry Reedy
"aeneng" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | def cross(u,v) |"""input two vectors u and v in 3-D space, | output a cross product of vector w, in column or in row | accordingly.""" |ppp1,ppp2,ppp3=0.0,0.0,0.0 To add to other comments, remove above which is

Re: Error message from function definition

2008-03-29 Thread Terry Reedy
Please do not post same question twice. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with sqlite

2008-03-29 Thread aiwarrior
On Mar 29, 6:41 pm, Gerhard Häring <[EMAIL PROTECTED]> wrote: > Ok, I'll review your code. > > aiwarrior wrote: > > class db: > > def __init__(self): #constructor > > conn = sqlite3.connect('./db.db') > > conn.isolation_level = None > > Autocommit mode is mostly for newbies who

Re: Finding Full Path to Process EXE

2008-03-29 Thread Michel Claveau - NoSpam SVP ; merci
Hi! Warning : WMI give the "command-line" of a process only for windows > 2000 @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Buffer Overflow with Python 2.5 on Vista in import site

2008-03-29 Thread Fuzzyman
A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the official msi installers and running on Vista under Parallels on the Mac). 'import site' fails due to a string in sys.path that contains a huge number of null bytes. The error is actually in ntpath - I adjusted it to print the paths i

Re: Problem with sqlite

2008-03-29 Thread Tzury Bar Yochay
after executing insert do conection.commit() -- http://mail.python.org/mailman/listinfo/python-list

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Dan Bishop
On Mar 29, 6:08 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > I don't know if this is the right place to discuss the death of <> in > > Python 3.0, or if there have been any meaningful discussions posted > > before (hard to search google with '<>' keyword), but wh

What motivates all unpaid volunteers at Pycon?

2008-03-29 Thread [EMAIL PROTECTED]
I was impressed and humbled by all the unpaid volunteers at Pycon. I was wondering what motivated so many people to give so much to the Python community. (I have my guesses but I'd rather listen than assume I know.) Any ideas? Chris -- http://mail.python.org/mailman/listinfo/python-list

regarding xml elements

2008-03-29 Thread Raj kumar
Hi, I have an xml file in my application, I have created an element using Example goes like this. document.createElement("abc") and i appeneded it by using append() method. But how i can reflect this change to my xml file? and one more thing is i want to create element with some other pa

cProfile for python 2.4

2008-03-29 Thread David Pratt
I'd like to compile cProfile for python 2.4. Where can I get it to do this? I realize it is part of python 2.5. Many thanks. -- http://mail.python.org/mailman/listinfo/python-list

New python forum on CodeGuru!

2008-03-29 Thread Robert Dailey
Hi, I managed to convince the CodeGuru forum administrator to add a Python discussion forum to the community. It's a great success for me, as I really love CodeGuru and their forums. I really encourage everyone to use it, as it will be a great asset to the Python community. The forum will be remov

Serial port error statistics - any comparable data?

2008-03-29 Thread Hendrik van Rooyen
Hi, I have been doing some tests on a device that we are thinking of incorporating into a product, and I have seen that reception on a serial port at 115200 baud over about six metres of RS-232 cable makes mistakes, to the order of 125 lines with errors in them out of approximately 18.4 million l

tkinter coordinates, conversion

2008-03-29 Thread Ron Provost
Is there any way in tkinter to convert between coordinate systems? Specifically, I'm refering to the canvas. I'm getting x and y's back in mouse events and I would like to convert them back to inches 'i', centemeters 'c', millimeters 'm' or points 'p'. Which I wish to use to provided informat

Re: cProfile for python 2.4

2008-03-29 Thread ptrk
On Mar 28, 3:50 pm, David Pratt <[EMAIL PROTECTED]> wrote: > I'd like to compile cProfile for python 2.4. Where can I get it to do > this? I realize it is part of python 2.5. Many thanks. can you use cProfile's predecessor, profile? http://docs.python.org/lib/module-profile.html -- http://mail.p

Re: Serial port error statistics - any comparable data?

2008-03-29 Thread Diez B. Roggisch
Hendrik van Rooyen schrieb: > Hi, > > I have been doing some tests on a device that > we are thinking of incorporating into a product, > and I have seen that reception on a serial port > at 115200 baud over about six metres of RS-232 > cable makes mistakes, to the order of 125 lines > with errors

wxPython listctrl

2008-03-29 Thread Gif
I was wondering if there is a way to extract an icon from a file (executable) and then add it in a listctrl. I also 'd like to know if i can shorten the icon in order to fit in a listctrl item. I've managed to get the icon from an icon file and add t as a listctrl item but it remains 32x32. code:

Python vs. Perl, which is better to learn?

2008-03-29 Thread linda vogele
4332951-- http://mail.python.org/mailman/listinfo/python-list

Re: Python and xml

2008-03-29 Thread Konstantin Veretennicov
On Sat, Mar 29, 2008 at 3:57 PM, Doran, Harold <[EMAIL PROTECTED]> wrote: > I am a python neophyte who has used python to parse through text files > using basic functions and no OOP experience. I have a need to process some > xml files and from what I am now reading python is the exact tool I nee

Re: What motivates all unpaid volunteers at Pycon?

2008-03-29 Thread Tim Chase
> I was wondering what motivated so many people to give so much to the > Python community. fear, surprise, ruthless efficiency, an almost fanatical devotion to the BDFL, and nice red uniforms. Oh... -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Licensing

2008-03-29 Thread Scott David Daniels
DS wrote: > I'm getting ready to publish a first open-source project written in > python. I am planning to use GPL as the license. However, in my code, > there is a function that I like from Python Cookbook > So, my options appear to be: > 1. Don't use it. > 2. Use it with no comment --

Re: Licensing

2008-03-29 Thread DS
Scott David Daniels wrote: > DS wrote: > >> I'm getting ready to publish a first open-source project written in >> python. I am planning to use GPL as the license. However, in my code, >> there is a function that I like from Python Cookbook >> So, my options appear to be: >> 1. Don't u

Re: Problem with python

2008-03-29 Thread Scott David Daniels
Lie wrote: > On Mar 30, 2:57 am, [EMAIL PROTECTED] wrote: >> Hi there. >> I ... started writing simple programs in the python gui... when I write >> python code ...[and]... double click it all that happens is a black box >> flashes up on the screen, but nothing else!? > > open the program i

Re: Installing simplejson issues

2008-03-29 Thread Diez B. Roggisch
Gabriel Genellina schrieb: > En Fri, 28 Mar 2008 23:23:01 -0300, <[EMAIL PROTECTED]> escribió: > >> On Mar 28, 1:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >>> En Fri, 28 Mar 2008 16:14:07 -0300, <[EMAIL PROTECTED]> escribió: >>> >>> > I am trying to install the twitter python wrappe

Re: Installing simplejson issues

2008-03-29 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am trying to install the twitter python wrapper...I got that > installed just fine, but am having serious troubles getting the > simplejson package to install. I need help diagnosing where this is > failing. I am trying to use: > > http://pypi.python.org/pypi/simpl

pexpect

2008-03-29 Thread Paul Lemelle
I am trying separate a script that users pexpect into various functions within the same expect session. The problem is that the function does not return control back Main. Any insight into this issue would be greatly appreciated. Below is sample code of the problem. Thanks, Paul impo

Re: pygame handoff

2008-03-29 Thread castironpi
On Mar 28, 5:09 am, [EMAIL PROTECTED] wrote: > Can anyone do a simple pygame render of a rollercoaster in first- > person?  I'll do the generator.  Just for fun for free.  (Ha see > pythaagh.  He bothered to carve it.  Have a nice day.) Does anyone want to team up on this: http://www.pygame.o

Can anyone help me?

2008-03-29 Thread castironpi
I have this. 'pycaster.py' works. 'spherecollide.py' doesn't. C:\Documents and Settings\usr\My Documents\inbin\SphereCollide> \programs\python2 5\python SphereCollide.py Traceback (most recent call last): File "SphereCollide.py", line 39, in dlWorld, dlSpheres, dlFakeshadow = Objects.main

Re: Change user on UNIX

2008-03-29 Thread Tim Roberts
"Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > >I'll try to describe what I'm actually trying to implement so that >maybe it can help you understand a little better. >The application is an asynchronous FTP server implementation. >I decided that it would be desirable to change the current >impleme

Re: Installing simplejson issues

2008-03-29 Thread blwatson
On Mar 29, 3:48 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > I am trying to install the twitter python wrapper...I got that > > installed just fine, but am having serious troubles getting the > > simplejson package to install.  I need help diagnosing wher

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 16:24:01 -0300, Michael Wieher <[EMAIL PROTECTED]> escribió: > to me it seems simple. > > C uses != > > why does C use != because its kind of hard to type the "equal with a > slash" In C, ! by itself is the logical "not", so !(a==b) is the same as (a!=b) and that's ra

Re: Passing function objects to timeit

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 07:33:40 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: > The timeit.Timer class times "code snippets" -- you pass it strings > rather than function objects. That's good for what it's worth, but > sometimes the code you want to time is too big to easily pass as a > stri

Re: Can anyone help me?

2008-03-29 Thread Paul McGuire
On Mar 29, 6:37 pm, [EMAIL PROTECTED] wrote: What is the collision of spheres? Is it the melding of a sphere of influence and cosmic sphere? What does it mean to say that such a collision "doesn't work"? The sphere is the optimal solid for storing the maximum volume in the minimum area. A sph

Re: Can anyone help me?

2008-03-29 Thread marek . rocki
I love Paul's response. [EMAIL PROTECTED] napisał(a): > My crystal ball broke a few days ago due to overuse, but I recall that OpenGL likes to have power-of-two texture sizes. If that doesn't work, please trim down your code as far as possible (so that it still displays the error) and post it. -

Re: Problem with sqlite

2008-03-29 Thread Tim Roberts
aiwarrior <[EMAIL PROTECTED]> wrote: > >I'm sorry about not saying showing the libraries. It was not on >purpose. You didn't make any comment on the rest of Gerhard's suggestion, nor does it appear that you took any action to correct them. You should get out of the habit of using extra parenthese

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 12:49:05 -0700, Carl Banks wrote: >> Please set it straight in 3.0, and if not, convince me with a good >> reason of doing so, so that I can live with it and don't have to spend >> the rest of my life in 2.x ;). > > 1. It's not going to change in Python 3.0. > > 2. It's a sil

Re: Installing simplejson issues

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 19:45:09 -0300, Diez B. Roggisch <[EMAIL PROTECTED]> escribió: >> I suggest that you remove the simplejson-xx.egg file and delete the >> simplejson entry in easy-install.pth (both in your site-packages >> directory) >> Then extract the simplejson directory from inside t

Re: Installing simplejson issues

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 20:54:36 -0300, <[EMAIL PROTECTED]> escribió: > I tried to add the directory "//simplejson" to my sys.path > in the interpreter, hoping that the call to import simplejson would > work if the dir was there, even though simplejson.py did not exist is > that dir, but the encoder,

Re: Problem with sqlite

2008-03-29 Thread Carsten Haese
On Mar 29, 9:10 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > aiwarrior <[EMAIL PROTECTED]> wrote: > >def get_value( self, column ): > >self.cursor.execute( "SELECT %s FROM database" % column ) > >for n in self.cursor: > > print n > > I suspect you wanted "self.cursor

Re: Can anyone help me?

2008-03-29 Thread castironpi
On Mar 29, 7:59 pm, [EMAIL PROTECTED] wrote: > I love Paul's response. > > [EMAIL PROTECTED] napisa³(a): > > > > > My crystal ball broke a few days ago due to overuse, but I recall that > OpenGL likes to have power-of-two texture sizes. If that doesn't work, > please trim down your code as far as

Re: Why prefer != over <> for Python 3.0?

2008-03-29 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >I don't know if this is the right place to discuss the death of <> in >Python 3.0, or if there have been any meaningful discussions posted >before (hard to search google with '<>' keyword), but why would anyone >prefer the comparison op

Re: Passing function objects to timeit

2008-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2008 21:12:33 -0300, Gabriel Genellina wrote: > En Sat, 29 Mar 2008 07:33:40 -0300, Steven D'Aprano > <[EMAIL PROTECTED]> escribió: > >> The timeit.Timer class times "code snippets" -- you pass it strings >> rather than function objects. That's good for what it's worth, but >> some

Re: problem with logic in reading a binary file

2008-03-29 Thread castironpi
On Mar 29, 2:11 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > I am having trouble writing the code to read a binary string.  I would > > like to extract the values for use in a calculation. > > > Any help would be great. > > Without having looked at your cod

Re: Buffer Overflow with Python 2.5 on Vista in import site

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 17:34:27 -0300, Fuzzyman <[EMAIL PROTECTED]> escribió: > A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the > official msi installers and running on Vista under Parallels on the > Mac). It may be actually a Parallels issue - I've installed 2.5.1 on Vista (just o

Re: What motivates all unpaid volunteers at Pycon?

2008-03-29 Thread Steve Holden
Tim Chase wrote: >> I was wondering what motivated so many people to give so much to the >> Python community. > > fear, surprise, ruthless efficiency, an almost fanatical devotion > to the BDFL, and nice red uniforms. > > Oh... > NOT THE COMFY CHAIR! (tm) -- Steve Holden+1 571 484 6266

Re: Can anyone help me?

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 21:48:21 -0300, Paul McGuire <[EMAIL PROTECTED]> escribió: > What is the collision of spheres? Is it the melding of a sphere of > influence and cosmic sphere? What does it mean to say that such a > collision "doesn't work"? The sphere is the optimal solid for storing > the

  1   2   >