Re: annonymous functions -- how to

2005-05-06 Thread Fredrik Lundh
Dave Benjamin wrote: > In this case, having to name these callback functions is tiring and > awkward, and (IMHO) disrupts the flow of my function: so name them all "func" or "next" or something, so you don't have to think. once the object is bound, the name is irrlevant. > def add_thingy(): >

Re: Hard times with packages and instances

2005-05-06 Thread Fredrik Lundh
Kay Schluehr wrote: > > if you manage to import the same thing multiple times, you'll have > > multiple class objects representing the same source code, and is- > > instance won't work properly. > > Importing a class/module multiple times does not cause the problem. > Writing > > import ForeignP

Re: How to detect a double's significant digits

2005-05-06 Thread Fredrik Lundh
Jeremy Bowers wrote: > > A step which will require him to tell the printing routine how many digits > > he wants printed. > > Not necessarily; consider the str() of a float in Python, especially given > the "significant digits" aspect (it may be ill-defined, but I can think of > several well-defin

Weird UserArray AttributeError (bug ?)

2005-05-06 Thread George Sakkis
I came across a strange error when trying to define a settable property for a new-style subclass of UserArray (Numeric). Here's a shorter example that reproduces the problem: from UserArray import UserArray from math import hypot class Vector(UserArray,object): def __init__(self,x,y):

RFC 2822 format date printing function in python

2005-05-06 Thread praba kar
Dear All, In Php we can print RFC 2822 formatted date by date('r') with parameter r. Then it will print the below format date. "Thu, 7 Apr 2005 01:46:36 -0300". I want to print same RFC 2822 format in python. Is it possible in python? . If possible kindly mention the function related to print

hard memory limits

2005-05-06 Thread Maurice LING
Hi, I think I've hit a system limit in python when I try to construct a list of 200,000 elements. My error is malloc: vm_allocate (size = 2400256) failed.. Just wondering is this specific to my system or what? Will adding more RAM helps in this case? Thanks and cheers Maurice -- http://m

Re: Hard times with packages and instances

2005-05-06 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > > if you manage to import the same thing multiple times, you'll have > > > multiple class objects representing the same source code, and is- > > > instance won't work properly. > > > > Importing a class/module multiple times does not cause the proble

Re: RFC 2822 format date printing function in python

2005-05-06 Thread George Yoshida
praba kar wrote: >In Php we can print RFC 2822 formatted date by > date('r') with parameter r. Then it will print the > below format date. > "Thu, 7 Apr 2005 01:46:36 -0300". > I want to print same RFC 2822 format in python. Is it > possible in python? . If possible kindly mention the

Re: Python at MS Event!

2005-05-06 Thread Srijit Kumar Bhadra
Was it IronPython 0.7.x or standard Python 2.4.1? Regards, /Srijit -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-06 Thread TZOTZIOY
On Fri, 29 Apr 2005 23:38:53 +0300, rumours say that pythonchallenge <[EMAIL PROTECTED]> might have written: >For the riddles' lovers among you, you are most invited to take part >in the Python Challenge, the first python programming riddle on the net. >You are invited to take part in it at: >htt

Re: hard memory limits

2005-05-06 Thread Fredrik Lundh
Maurice LING wrote: > I think I've hit a system limit in python when I try to construct a list > of 200,000 elements. there's no such limit in Python. > My error is > > malloc: vm_allocate (size = 2400256) failed.. > > Just wondering is this specific to my system or what? that doesn't look

Re: RFC 2822 format date printing function in python

2005-05-06 Thread Fredrik Lundh
"praba kar" wrote: >In Php we can print RFC 2822 formatted date by > date('r') with parameter r. Then it will print the > below format date. > "Thu, 7 Apr 2005 01:46:36 -0300". > I want to print same RFC 2822 format in python. Is it > possible in python? . If possible kindly mention the > fu

Re: Setting the corner color in rotated PIL images

2005-05-06 Thread Anthra Norell
What do you mean 'is required'? I tend to think that getting ahead with a job is what is required. I don't sneer at work-arounds if they save time. Frederic A somewhat craftier solution, if still pretty hackish, would be to go through your image pixel by pixel, look what color each one is (color

Re: properties vs. eval()

2005-05-06 Thread Steve Holden
Bob Rogers wrote: > So you're saying you don't know the answer? The question wasn't > "should I use setattr?" > No, the "*question*" was (paraphrasing slightly) "is [it] possible to dispense with the compile step and use eval() alone while setting a property" the *answer* was "you should use se

Re: win32: structured storage

2005-05-06 Thread Steve Holden
tlviewer wrote: > hello, > > In honor of the chm exploit that I got hit by last week, I trying > to code some ActivePython to list the directory inside a CHM. > Welcome to the world of the "drive-by download". Now you know why people are recommending migrating away from IE. > CHM is supposed t

Re: New Python regex Doc

2005-05-06 Thread Steve Holden
Fredrik Lundh wrote: > Xah Lee wrote: > > >>I have now also started to rewrite the re-syntax page. At first i >>thought that page needs not to be rewritten, since its about regex and >>not really involved with Python. But after another look, that page is >>as incompetent as every other page of Py

Re: win32: structured storage

2005-05-06 Thread Robert Kern
tlviewer wrote: > Is there another way to parse the central directory out of > a CHM file? google("chmlib python") -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mai

Re: Setting the corner color in rotated PIL images

2005-05-06 Thread rzed
[Following up] > - Original Message - > From: "rzed" <[EMAIL PROTECTED]> > Newsgroups: comp.lang.python > To: > Sent: Sunday, May 01, 2005 1:17 PM > Subject: Setting the corner color in rotated PIL images > > >> I'm using PIL to generate some images which may be rotated at >> the user's

Re: py2exe + svn - the final drama

2005-05-06 Thread Timothy Smith
Timothy Smith wrote: >ok, i am updating my program from my svn - this works, however, i am >getting the following error when i close the program. the zip file >successfully updates, so i'm curious as to the meaning of this. > >Traceback (most recent call last): > File "Main.pyo", line 820, in V

Re: Setting the corner color in rotated PIL images

2005-05-06 Thread Fredrik Lundh
"rzed" wrote: > I'm using PIL to generate some images which may be rotated at the > user's option. When they are rotated, the original image is cropped > in the new image (which is fine), and the corners are black (which > is not, in this case). I can't find any documented way to change > the defa

Tkinter App to System Tray

2005-05-06 Thread 陈阳
I write a program with Python 2.4 + TkinterExecute it, there will be a window show something.If I minimize it, it will be minimized to the taskbar. But I would like it to miniminze to the System Tray, this can make taskbar more clear. Would you please tell me how to modify my program.

Re: How to detect a double's significant digits

2005-05-06 Thread John Roth
"mrstephengross" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all... How can I find out the number of significant digits (to the > right of the decimal place, that is) in a double? At least, I *think* > that's what I'm asking for. For instance: > > 0.103 --> 3 > 0.0103 --> 4 >

Re: Python & SQLite

2005-05-06 Thread dcrespo
> There are specific python modules for SQLite on Linux. Which? I thought pysqlite works on Linux. My important question is: If I develop an app using Python-wxPython-PySQLite under Windows, and run it on Linux, it should work, ¿right? Daniel -- http://mail.python.org/mailman/listinfo/python-l

[HELP] Tkinter Application Minimized to System Tray :)

2005-05-06 Thread 陈 阳
I write a program with Python 2.4 + Tkinter Execute it, there will be a window show something. If I minimize it, it will be minimized to the taskbar. But I would like it to miniminze to the System Tray, this can make taskbar more clear. Would you please tell me how to modify my program.

Re: Setting the corner color in rotated PIL images

2005-05-06 Thread rzed
"Anthra Norell" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > What do you mean 'is required'? I tend to think that getting > ahead with a job is what is required. I don't sneer at > work-arounds if they save time. > > Frederic > > A somewhat craftier solution, if still pretty hackish,

Re: hard memory limits

2005-05-06 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Maurice LING wrote: >> Will adding more RAM helps in this case? > > probably. more swap space might also help. or you could use a > smarter malloc package. posting more details on your platform, > toolchain, python version, and list building approac

Re: ERP & CRM in Python

2005-05-06 Thread Wolfgang Keller
Hello, and thanks for your reply. > We are writing a script to render a PDF from our doc. (using > openreport.org) Good to read. > > Why not mailing lists instead of online-"forums". > There is some mailing lists; > http://tinyerp.org/lists.php > ... but nobody uses it. > > > The former was ma

Re: hard memory limits

2005-05-06 Thread Bill Mill
On 5/6/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > > Maurice LING wrote: > >> Will adding more RAM helps in this case? > > > > probably. more swap space might also help. or you could use a > > smarter malloc package. posting more details on your p

Re: Python & SQLite

2005-05-06 Thread Gerhard Häring
dcrespo wrote: >>There are specific python modules for SQLite on Linux. > > Which? I thought pysqlite works on Linux. Sure. What he probably meant was that there are binary installers for pysqlite from various Linux distributions (Debian, Gentoo, ...). > My important question is: If I develop a

Re: Encryption with Python?

2005-05-06 Thread Ivan Voras
Blake T. Garretson wrote: > I want to save some sensitive data (passwords, PIN numbers, etc.) to > disk in a secure manner in one of my programs. What is the > easiest/best way to accomplish strong file encryption in Python? Any > modern block cipher will do: AES, Blowfish, etc. I'm not looking

Getting number of iteration

2005-05-06 Thread Florian Lindner
Hello, when I'm iterating through a list with: for x in list: how can I get the number of the current iteration? Thx, Florian -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting number of iteration

2005-05-06 Thread Bill Mill
On 5/6/05, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > when I'm iterating through a list with: > > for x in list: > > how can I get the number of the current iteration? Python 2.4 and greater: for n, x in enumerate(lst): print "iteration %d on element %s" % (n, x) Earlier: n = 0

Re: Getting number of iteration

2005-05-06 Thread Bill Mill
On 5/6/05, Bill Mill <[EMAIL PROTECTED]> wrote: > On 5/6/05, Florian Lindner <[EMAIL PROTECTED]> wrote: > > Hello, > > when I'm iterating through a list with: > > > > for x in list: > > > > how can I get the number of the current iteration? > > Python 2.4 and greater: ummm, make that 2.3 and grea

Re: Getting number of iteration

2005-05-06 Thread George Sakkis
"Florian Lindner" wrote: > Hello, > when I'm iterating through a list with: > > for x in list: > > how can I get the number of the current iteration? > > Thx, > > Florianfor in python 2.3+: for i,x in enumerate(sequence): print "sequence[%d] = %s" %(i,x) George -- http://mail.python.org/

Re: annonymous functions -- how to

2005-05-06 Thread Scott David Daniels
Fredrik Lundh wrote: > > so name them all "func" or "next" or something, so you don't have > to think. once the object is bound, the name is irrlevant. > Or, you could tell him about the reserved word anonymous which can be used to created unnamed functions of values. A sample definition and use

Re: Best way to convert a list into function call arguments?

2005-05-06 Thread bruno modulix
[EMAIL PROTECTED] wrote: > I'm a newcomer to python - what is the best way to convert a list into > a function call agruments? Jeff Epler already answered to the question. Now a couple of advices: > For example: > > list = (2005, 5, 5) 1/ this is not a list, it's a tuple. A list would be [2005,

Re: min max of a list

2005-05-06 Thread querypk
Hi Steve! I am not sure if I was clear with my previous post .Ok let me rephrase it . Assume the values list is the content of a histogram. Then we see that values = [ 0, 72, 2, 4, 9, 2, 0, 0, 42, 26, 0, 282, 23, 0, 101, 0, 0, 0, 0, 0] 1 is repeated 72 times, 3 -> 4 t

Re: How to detect a double's significant digits

2005-05-06 Thread Jeremy Bowers
On Fri, 06 May 2005 08:27:03 +0200, Fredrik Lundh wrote: > Jeremy Bowers wrote: > >> > A step which will require him to tell the printing routine how many >> > digits he wants printed. >> >> Not necessarily; consider the str() of a float in Python, especially >> given the "significant digits" asp

Re: a cx_Oracle ORA-01036 problem

2005-05-06 Thread Miles
Damjan wrote: > I'm using Python 2.4, cx_Oracle-4.1 on Linux with Oracle instant client > 10.1.0.3. This is the sql string: > > SQL = """insert into D.D_NOTIFY values (:CARDREF, :BANKKEY, :OK1, :OK2 \ > :DEBTEUR, :DEBTDEN, to_date(:INVOICE_DATE,'DD.MM.YY'), > to_date(:PAYMENT_DEADL

Re: annonymous functions -- how to

2005-05-06 Thread Dave Benjamin
Fredrik Lundh wrote: > Dave Benjamin wrote: > >>In this case, having to name these callback functions is tiring and >>awkward, and (IMHO) disrupts the flow of my function: > > so name them all "func" or "next" or something, so you don't have > to think. once the object is bound, the name is irrl

Re: Python at MS Event!

2005-05-06 Thread James
Standard. 2.4.x -- http://mail.python.org/mailman/listinfo/python-list

Re: annonymous functions -- how to

2005-05-06 Thread Fredrik Lundh
Dave Benjamin wrote: > > so name them all "func" or "next" or something, so you don't have > > to think. once the object is bound, the name is irrlevant. > > Sure, you could do this, but then you'd have multiple functions at > different nesting levels with the same name, which would be confusing.

Re: Weird UserArray AttributeError (bug ?)

2005-05-06 Thread George Sakkis
To answer my own question, the error is caused by the __setattr__ defined in UserArray: def __setattr__(self,attr,value): if attr=='shape': self.array.shape=value self.__dict__[attr]=value I'm not sure though how to "undefine" __setattr__ in a subclass so that property

SC-Corporate-ID released

2005-05-06 Thread Philippe C. Martin
Dear all, I am very pleased to announce the release of SC-Corporate-ID. SC-Corporate-ID is a commercial Smart Card security system that can be extended by the user using the Python language. SC-Corporate-ID is written in Python and wxPython for the most part (except for the PCSC wrapper, the GIN

Re: hard memory limits

2005-05-06 Thread Fredrik Lundh
Mike Meyer wrote: > Without platform information, it's hard to say. On a modern Unix > system, you only run into system resource limits when the system is > heavily loaded. Otherwise, you're going to hit per-process limits. In > the latter case, adding RAM or swap won't help at all. Raising the >

Re: annonymous functions -- how to

2005-05-06 Thread Dave Benjamin
Fredrik Lundh wrote: > Dave Benjamin wrote: > >>>so name them all "func" or "next" or something, so you don't have >>>to think. once the object is bound, the name is irrlevant. >> >>Sure, you could do this, but then you'd have multiple functions at >>different nesting levels with the same name, w

Re: hard memory limits

2005-05-06 Thread James Stroud
On Friday 06 May 2005 10:29 am, Fredrik Lundh wrote: > Mike Meyer wrote: > > Without platform information, it's hard to say. On a modern Unix > > system, you only run into system resource limits when the system is > > heavily loaded. Otherwise, you're going to hit per-process limits. In > > the lat

inheritance with new-style classes - help

2005-05-06 Thread Greg Copeland
Okay, I have: class Base( object ): def __init__( self ): self._attrib = "base" print "Base" def real( self ): print "Base.real() is calling base.virtual()" self.virtual() def virtual( self ): print "Base virtual()" pass class Mothe

Re: min max of a list

2005-05-06 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > If this is the list. > > values = [ 0, 72, 0, 4, 9, 2, 0, 0, 42, 26, 0, 282, > 23, 0, 101, 0, 0, 0, 0, 0] > > as we can see there are peaks in the list.that is 0,72,0 is a > group(triangle) with peak 72.then 0, 4, 9, 2, 0, 0 with pe

Re: inheritance with new-style classes - help

2005-05-06 Thread Greg Copeland
BTW, this is on Python 2.3.4. -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance with new-style classes - help

2005-05-06 Thread Greg Copeland
Doh! Child's __init__ was declared as __init(). Fixing that took care of it! Sorry for wasting the bandwidth! Cheers, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Tons of stats/opens to non-existing files increases Python's startupon loaded NFS servers

2005-05-06 Thread Dieter Maurer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Fri, 6 May 2005 00:08:36 +0200: > > ... lots of "no such file or directory ... > > Whoa!! After looking at what is being stat'd or > > open'd, it looks like 'encodings' is new in 2.4 and, > > even "worse", everything is looked for as a zip first. > > s

Re: hard memory limits

2005-05-06 Thread Fredrik Lundh
James Stroud wrote: > > does Mac OS X ship with memory limits set by default? isn't that > > a single-user system? > > Dear original poster or whoever is interested in OS X: > > OS X is not a single user system. It is BSD based unix. And its [EMAIL > PROTECTED] > sweet! (Though I'm u

Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? GOOGLE·NEWSGROUP·POST·156

2005-05-06 Thread Please
Abuse reports to [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance with new-style classes - help

2005-05-06 Thread Terry Reedy
"Greg Copeland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Okay, I have: [snip] >self._childAttrib = "child" ... > AttributeError: 'Child' object has no attribute '_childAttrib' x.__dict__ > {'_attrib': 'base'} > > What??! Where the heck did self._childAttrib go?

Re: min max of a list

2005-05-06 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Hi Steve! > I am not sure if I was clear with my previous post .Ok let me rephrase > it . > > Assume the values list is the > content of a histogram. Then we see that > values = [ 0, 72, 2, 4, 9, 2, 0, 0, 42, 26, 0, 282, > 23, 0, 101, 0, 0, 0, 0

Re: hard memory limits

2005-05-06 Thread James Stroud
On Friday 06 May 2005 11:27 am, Fredrik Lundh wrote: > James Stroud wrote: > > > does Mac OS X ship with memory limits set by default? isn't that > > > a single-user system? > > > > Dear original poster or whoever is interested in OS X: > > > > OS X is not a single user system. It is BSD based uni

Re: min max of a list

2005-05-06 Thread querypk
Hi Kent, Thanks for that. But We are considering [..., 0, 101, 0, 0, 0, 0, 0] -> [13,18] .In fact if you look at the list, the histogram ends at 15 that is [0,101,0] --> [13,15]. Dont you think so. -- http://mail.python.org/mailman/listinfo/python-list

Running python cgi scripts that require external cvs under apache

2005-05-06 Thread chris . levis
All: I have written a Python webapp under MS IIS 5.0 that does the following: -Does a CVS checkout of a particular bit of xml -Gets a list of valid cvs tags for that xml file -Based on user input via forms, modifies that xml -CVS checkin's that file To have correct

Re: min max of a list

2005-05-06 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hi Kent, > Thanks for that. But We are considering [..., 0, 101, 0, 0, 0, 0, 0] -> > [13,18] .In fact if you look at the list, the histogram ends at 15 that > is [0,101,0] --> [13,15]. Dont you think so. > Well you consider ..., 0, 4, 9, 2, 0, 0, ... as an int

Re: min max of a list

2005-05-06 Thread querypk
I get a syntax error in : py> [(min((abs(p - v), v) for v in valleys + [0] if v < p)[1], ... p, ... min((abs(p - v), v) for v in valleys if v > p)[1]) ... for p in peaks] -- http://mail.python.org/mailman/listinfo/python-list

Re: win32: structured storage

2005-05-06 Thread Dave Benjamin
Steve Holden wrote: > tlviewer wrote: > > > CHM is supposed to be structured storage (ITSF). If a given CHM > > file is infected it most likely has an embedded EXE file -- mine > > had one called [Open.exe]. > > > Ironic, really, since Microsoft insist that the browser must be > fully-integra

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-06 Thread Jeff Epler
To add to what others have said: * Typos and lack of spell-checking, such as "occurances" vs "occurrences" * Poor grammar, such as "Other characters that has special meaning includes:" * You dropped version-related notes like "New in version 2.4" * You seem to love the use of s, while docs.py

Re: min max of a list

2005-05-06 Thread querypk
oh yes its the same case. even [0,4,9,2,0] as a set [2,6] and may be not [2,7]. Its not that you are wrong its jus that I was not clear. Sorry about that. -- http://mail.python.org/mailman/listinfo/python-list

Re: [HELP] Tkinter Application Minimized to System Tray :)

2005-05-06 Thread Jeff Epler
Tk, the library that Tkinter wraps, does not offer a way to "minimize to the taskbar". Jeff pgp3ATXnxg0dO.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting number of iteration

2005-05-06 Thread Mike Meyer
Bill Mill <[EMAIL PROTECTED]> writes: > On 5/6/05, Florian Lindner <[EMAIL PROTECTED]> wrote: >> Hello, >> when I'm iterating through a list with: >> >> for x in list: >> >> how can I get the number of the current iteration? > Earlier: > > n = 0 > for x in lst: > print "iteration %d on eleme

Re: annonymous functions -- how to

2005-05-06 Thread Peter Hansen
Dave Benjamin wrote: > def add_thingy(): > def func(thingy_id): > print 'got thingy id:', thingy_id > def funnc(doodad_id): > print 'got doodad id:', doodad_id > def func(thingy_doodad): > print 'thingy doodad created, froobling...' >

Re: min max of a list

2005-05-06 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I get a syntax error in : > > py> [(min((abs(p - v), v) for v in valleys + [0] if v < p)[1], > ... p, > ... min((abs(p - v), v) for v in valleys if v > p)[1]) > ... for p in peaks] I think we already covered the part where you were using an older version of Pyth

Multiple Inheritence and data attributes

2005-05-06 Thread Derek Basch
Hello Everyone, Given: class A: def __init__(self): super(A, self).__init__() self.dog = "fluffy" def changeDog(self): self.dog = "spike" class B: def __init__(self): super(B, self).__init__() class C(object, A, B): def __init__(self): sup

Re: Running python cgi scripts that require external cvs under apache

2005-05-06 Thread Noah
How do you run the cvs binary from your script? If this is a simple CGI that calls os.popen() or os.system() then the cvs binary is most likely running as the same user as the Apache HTTP server (usually someone like "nobody", "apache", or "www"). http://cgiwrap.unixtools.org/ is one solution. Al

Re: win32: structured storage

2005-05-06 Thread Dave Benjamin
Dave Benjamin wrote: > Steve Holden wrote: > >> tlviewer wrote: >> >> > CHM is supposed to be structured storage (ITSF). If a given CHM >> > file is infected it most likely has an embedded EXE file -- mine >> > had one called [Open.exe]. >> > >> Ironic, really, since Microsoft insist that the

Re: hard memory limits

2005-05-06 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > James Stroud wrote: > >> > does Mac OS X ship with memory limits set by default? isn't that >> > a single-user system? >> >> Dear original poster or whoever is interested in OS X: >> >> OS X is not a single user system. It is BSD based unix. And its [

Re: py2exe + svn - the final drama

2005-05-06 Thread David Bolen
Timothy Smith <[EMAIL PROTECTED]> writes: > Timothy Smith wrote: (...) > >zipimport.ZipImportError: bad local file header in Z:\temp\library.zip > > > > not that once i have finished client.update(''), it has successfully > > updated the zipfile, i open a dialoge box saying "click ok and > > resta

Re: win32: structured storage

2005-05-06 Thread tlviewer
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > tlviewer wrote: > > > Is there another way to parse the central directory out of > > a CHM file? > > google("chmlib python") Anyone know the calling syntax for the functions? PythonWin 2.3.2 (#49, Nov 13 2003, 10:34:54

Re: hard memory limits

2005-05-06 Thread John Machin
On Fri, 06 May 2005 18:24:21 +1000, Maurice LING <[EMAIL PROTECTED]> wrote: >Hi, > >I think I've hit a system limit in python when I try to construct a list >of 200,000 elements. My error is > >malloc: vm_allocate (size = 2400256) failed.. > >Just wondering is this specific to my system or wh

handling more databases with ZEO

2005-05-06 Thread Almad
Hello, I'm using zodb with zeo and I want to connect to more databases from my application. On server side, it's no problem, I just set up second filestorage: path /var/www/databases/zodb/almad-net.fs path /var/www/databases/zodb/azilla.fs However, I dunno how to connect fr

Re: Multiple Inheritence and data attributes

2005-05-06 Thread [EMAIL PROTECTED]
Two things: - A call to super doesn't make senseif a class is not derived, and class b seems superfuous. - Code below is a working example of your code, the way you did it it generates an error. -#!/usr/bin/env python -class A(object): -def __init__(self): -super(A, self).__init__() -

Re: hard memory limits

2005-05-06 Thread Maurice LING
Hi everyone, thanks for your help. Yes, I'm using Mac OSX 1.3 with 256MB Ram. Each element in the list is a float. The list is actually a retrieved results of document IDs from SOAP interface. And Mac OSX does not have 'unlimit' command as shown, Maurice-Lings-Computer:~ mauriceling$ unlimit -

Re: min max of a list

2005-05-06 Thread Steven Bethard
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > >> I get a syntax error in : >> >> py> [(min((abs(p - v), v) for v in valleys + [0] if v < p)[1], >> ... p, >> ... min((abs(p - v), v) for v in valleys if v > p)[1]) >> ... for p in peaks] > > > I think we already covered the part where you

Re: hard memory limits

2005-05-06 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: > Hi everyone, > > thanks for your help. > > Yes, I'm using Mac OSX 1.3 with 256MB Ram. Each element in the list is > a float. The list is actually a retrieved results of document IDs from > SOAP interface. And Mac OSX does not have 'unlimit' command as sho

Re: py2exe + svn - the final drama

2005-05-06 Thread Just
In article <[EMAIL PROTECTED]>, David Bolen <[EMAIL PROTECTED]> wrote: > Are you perhaps trying to update the zip file in-place while it is still > being used by the application? I'm not sure that's a safe operation. I'm sure it's not :) [lots of useful help snipped] the zipimport module has

Reference to self not passed to member function

2005-05-06 Thread James Stroud
Hello All, I did this: py> class bob(object): ... def __init__(self,**kwargs): ... for fname,func in kwargs.items(): ... setattr(self, fname, lambda *args : func(*args)) ... py> def doit(): ... print "wuzzup?" ... py> abob = bob(doit=doit) py> py> abob.doit() wuzzup? Much to my su

Re: hard memory limits

2005-05-06 Thread Fredrik Lundh
Mike Meyer wrote: > > So why would Apple insist on setting unusably low process limits, when > > the others don't? > > You're making an unwarranted assumption here - that the OP wasn't > creating a large process of some kind. You need a special license to create large processes on a Mac? I click

Re: hard memory limits

2005-05-06 Thread James Stroud
Sorry Maurice, apparently in bash its "ulimit" (no n). I don't use bash, so I don't know all of the differences offhand. Try that. James On Friday 06 May 2005 03:02 pm, Maurice LING wrote: > Hi everyone, > > thanks for your help. > > Yes, I'm using Mac OSX 1.3 with 256MB Ram. Each element in the

Re: Reference to self not passed to member function

2005-05-06 Thread [EMAIL PROTECTED]
I think it is more clear to rephrase your code as: -#!/usr/bin/env python -class bob(object): -def __init__(self,**kwargs): -print kwargs -for fname,func in kwargs.items(): -setattr(self, fname, lambda *args : func(*args)) - -def doit(): -print "wuzzup?" - - -abo

Re: Getting number of iteration

2005-05-06 Thread Fredrik Lundh
Mike Meyer wrote: > > n = 0 > > for x in lst: > > print "iteration %d on element %s" % (n, x) > > n += 1 > > Just for the record, the old idiom was: > > for n in xrange(len(lst)): > x = lst[n] > print "iteration %d on element %s" % (n, x) it was? of the following four solutions,

ANN: RUR-PLE version 0.8

2005-05-06 Thread André Roberge
RUR-PLE is a "Python Learning Environment". It contains four main elements: 1. Lessons viewable within an incorporated browser. Version 0.8 includes 25 lessons introducing Python. 2. A "robot world" with a robot that can accomplish tasks through Python programs. 3. A built-in interpreter which c

Re: py2exe + svn - the final drama

2005-05-06 Thread Timothy Smith
Just wrote: >In article <[EMAIL PROTECTED]>, > David Bolen <[EMAIL PROTECTED]> wrote: > > > >>Are you perhaps trying to update the zip file in-place while it is still >>being used by the application? I'm not sure that's a safe operation. >> >> > >I'm sure it's not :) > >[lots of useful hel

Re: Reference to self not passed to member function

2005-05-06 Thread Fredrik Lundh
James Stroud wrote: > I did this: > > py> class bob(object): > ... def __init__(self,**kwargs): > ... for fname,func in kwargs.items(): > ... setattr(self, fname, lambda *args : func(*args)) > ... > py> def doit(): > ... print "wuzzup?" > ... > py> abob = bob(doit=doit) > py> > py> a

Re: py2exe + svn - the final drama

2005-05-06 Thread David Bolen
Just <[EMAIL PROTECTED]> writes: > the zipimport module has an attr called _zip_directory_cache, which is a > dict you can .clear(). Still, reloading modules is hairy at best, its > probably easiest to relaunch your app when the .zip file has changed. Except that he's getting an error during th

Re: Reference to self not passed to member function

2005-05-06 Thread Scott David Daniels
James Stroud wrote: > Hello All, > > I did this: > > py> class bob(object): > ... def __init__(self,**kwargs): > ... for fname,func in kwargs.items(): > ... setattr(self, fname, lambda *args : func(*args)) > ... > py> def doit(): > ... print "wuzzup?" > ... > py> abob = bob(doit=doi

Re: Reference to self not passed to member function

2005-05-06 Thread James Stroud
Thanks to both Scott and Fredrik. James On Friday 06 May 2005 04:22 pm, Scott David Daniels wrote: > James Stroud wrote: > > Hello All, > > > > I did this: > > > > py> class bob(object): > > ... def __init__(self,**kwargs): > > ... for fname,func in kwargs.items(): > > ... setattr(sel

Re: py2exe + svn - the final drama

2005-05-06 Thread David Bolen
Timothy Smith <[EMAIL PROTECTED]> writes: > what i do is as soon as the update is complete i close the app, but it > still gives the error, i tried clear() after update and before it, it > still got the same error. it's be nice to not have to fiddle around > with the zip file, i really think makin

Re: hard memory limits

2005-05-06 Thread James Tanis
James Stroud wrote: >Sorry Maurice, apparently in bash its "ulimit" (no n). I don't use bash, so I >don't know all of the differences offhand. Try that. > > The only shells I know of that uses unlimit is csh & tcsh.. bleh.. :) FWIW, I've had the same problem in openbsd, while ulimit will fix

Re: New Python regex Doc (was: Python documentation moronicities)

2005-05-06 Thread Xah Lee
HTML Problems in Python Doc I don't know what kind of system is used to generate the Python docs, but it is quite unpleasant to work with manually, as there are egregious errors and inconsistencies. For example, on the âModule Contentsâ page ( http://python.org/doc/2.4.1/lib/node111.html ), the c

Re: annonymous functions -- how to

2005-05-06 Thread Dave Benjamin
Peter Hansen wrote: > Dave Benjamin wrote: > >> def add_thingy(): >> def func(thingy_id): >> print 'got thingy id:', thingy_id >> def funnc(doodad_id): >> print 'got doodad id:', doodad_id >> def func(thingy_doodad): >> print 'thingy dood

Re: py2exe + svn - the final drama

2005-05-06 Thread Timothy Smith
David Bolen wrote: >Timothy Smith <[EMAIL PROTECTED]> writes: > > > >>what i do is as soon as the update is complete i close the app, but it >>still gives the error, i tried clear() after update and before it, it >>still got the same error. it's be nice to not have to fiddle around >>with the zi

Re: hard memory limits

2005-05-06 Thread Maurice LING
James Stroud wrote: > Sorry Maurice, apparently in bash its "ulimit" (no n). I don't use bash, so I > don't know all of the differences offhand. Try that. > > James Thanks guys, It doesn't seems to help. I'm thinking that it might be a SOAPpy problem. The allocation fails when I grab a list o

how to make a LAN game using python?

2005-05-06 Thread flyaflya
I want make a desktop game suports LAN connect, but pygame has nothing about network.How to let pygame suport LAN connect? have you some examples or articles about LAN connect? -- http://mail.python.org/mailman/listinfo/python-list

Re: hard memory limits

2005-05-06 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> > So why would Apple insist on setting unusably low process limits, when >> > the others don't? >> >> You're making an unwarranted assumption here - that the OP wasn't >> creating a large process of some kind. > > You need a spec

  1   2   >