Re: Tkinter question

2006-10-23 Thread Hendrik van Rooyen
Sorin Schwimmer wrote: Hi All, Is it possible to have a widget id while it is created? Something like this: Button(root, text='...', command= lambda v=: fn(v)).grid() and then the function: def fn(v): v['bg']='BLUE' # or maybe nametowidget(v)['bg']='BLUE' Thanks, Sorin - just give the t

Re: Rabbit Modules - Dynamic C - Python

2006-10-23 Thread Hendrik van Rooyen
"Picio" <[EMAIL PROTECTED]> wrote: > Hello, > I would wonder if anyone knows something about programming with > Python, Rabbit Core Modules, that normally were programmed with Dynamic > C. > > I mean either: > - something like using python to create code in dynamic suitable for > the rabbit core

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-23 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: Méta-MCI wrote: > For the professional developments, it is a major risk. some days, I ask myself why I shouldn't just use GPL for everything I do, and ship it as source code only. because then you would deny your work to thousands of ungrateful, un

Re: How to upgrade python from 2.4.3 to 2.4.4 ?

2006-10-23 Thread Tim Roberts
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Sun, 22 Oct 2006 01:55:53 GMT, Tim Roberts <[EMAIL PROTECTED]> declaimed >the following in comp.lang.python: > >> Having learned that lesson the hard way, I now keep a directory with zips >> and tarballs for all of the add-ins I have installed, and

Re: python GUIs comparison (want)

2006-10-23 Thread Cameron Walsh
[EMAIL PROTECTED] wrote: > Now i began to learn GUI programming. There are so many > choices of GUI in the python world, wxPython, pyGTK, PyQT, > Tkinter, .etc, it's difficult for a novice to decide, however. > Can you draw a comparison among them on easy coding, pythonish design, > beautiful and g

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread Fredrik Lundh
sturlamolden wrote: > Looking at Python's source (mmapmodule.c), it seems that "mmap.mmap" > always sets the offset argument in Windows' MapViewOfFile and UNIX' > mmap to 0. This means that it is always mapping from the beginning of > the file. Thus, Python's mmap module is useless for large files

Re: python GUIs comparison (want)

2006-10-23 Thread John Henry
[EMAIL PROTECTED] wrote: > Now i began to learn GUI programming. There are so many > choices of GUI in the python world, wxPython, pyGTK, PyQT, > Tkinter, .etc, it's difficult for a novice to decide, however. > Can you draw a comparison among them on easy coding, pythonish design, > beautiful and

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Fredrik Lundh
Steve Holden wrote: >> 3) pix = im.load() >> print pix[44,55] >> pix[44, 55] = value >> my python cannt identify "[x,y]" ?? >> > > Now what makes you think that an image can be addressed that way? I'd be > quite surprised if yo got anything other than a TypeError

Re: multythreading app memory consumption

2006-10-23 Thread Bryan Olson
Gabriel Genellina wrote: > At Sunday 22/10/2006 20:31, Roman Petrichev wrote: > >> I've just faced with very nasty memory consumption problem. >> I have a multythreaded app with 150 threads which use the only and the >> same function - through urllib2 it just gets the web page's html code >> and a

Re: multythreading app memory consumption

2006-10-23 Thread Bryan Olson
Dennis Lee Bieber wrote: > How much stack space gets allocated for 150 threads? In Python 2.5, each thread will be allocated thread.stack_size() bytes of stack address space. Note that address space is not physical memory, nor even virtual memory. On modern operating systems, the memo

Re: Help: Python2.3 & Python2.4 on RHEL4 x86_64

2006-10-23 Thread Martin v. Löwis
Christopher Taylor schrieb: > Also, I've fooled around with passing --libdir=/usr/lib64 to the > configure script and for whatever reason, the Makefile isn't correctly > written. It always ends up copying the lib files to /usr/lib. Ah, I see. The reason is pretty simple: Makefile.pre.in has LIB

Re: multythreading app memory consumption

2006-10-23 Thread Bryan Olson
Roman Petrichev wrote: > Hi folks. > I've just faced with very nasty memory consumption problem. > I have a multythreaded app with 150 threads [...] > > The test app code: > > > Q = Queue.Queue() > for i in rez: #rez length - 5000 > Q.put(i) > > > def checker(): > while True: >

Re: Socket module bug on OpenVMS

2006-10-23 Thread Martin v. Löwis
Irmen de Jong schrieb: > Although I'm not yet convinced about the all-or-nothing failure > model you were talking about. How can I know if recv() fails > with a MemoryError (or socket error) that it actually didn't > receive anything? Is that even an assumption I can rely on? Yes, you can. It can'

[ANN]UliPad 3.5 released

2006-10-23 Thread limodou
What's it? It's an Editor based on wxPython. NewEdit is the old name, and UliPad is the new name. UliPad uses Mixin and Plugin technique as its architecture. Most of its classes can be extended via mixin and plugin components, and finally become an integrity class at creating the instance

Talks at PyCon that Teach How to Be Better Programmers

2006-10-23 Thread Jeff Rush
I've been looking over the mix of talk proposals we have so far for PyCon 2007. We're got 17 so far, with a good number of case histories. Now case histories are good, don't get me wrong, we want Python to be successful and it is interesting to hear how it is being used. But according to the

Re: SSL follow up

2006-10-23 Thread Paul Rubin
Yogesh Chawla - PD <[EMAIL PROTECTED]> writes: > 2) I like the idea of calling openssl in a subprocess. > Do you have any of those openssl commands handy? If > not, I can look through the documentation tommorrow. To dump out the certificate? Try: openssl x509 -text -in filename.crt if the

python GUIs comparison (want)

2006-10-23 Thread [EMAIL PROTECTED]
Now i began to learn GUI programming. There are so many choices of GUI in the python world, wxPython, pyGTK, PyQT, Tkinter, .etc, it's difficult for a novice to decide, however. Can you draw a comparison among them on easy coding, pythonish design, beautiful and generous looking, powerful developme

SSL follow up

2006-10-23 Thread Yogesh Chawla - PD
Hi Paul and John, Thanks for the SSL follow up messages. I have 2 questions. 1) How do we get the Server cert in python. John wrote: "Nor does there seem to be a way to get at the certificate itself from within Python." Perhaps pycurl will allow us to do this. Is there another method to get th

RE: Sorting by item_in_another_list

2006-10-23 Thread Delaney, Timothy (Tim)
Cameron Walsh wrote: > Hi, > > I have two lists, A and B, such that B is a subset of A. > > I wish to sort A such that the elements in B are at the beginning of > A, and keep the existing order otherwise, i.e. stable sort. The > order of elements in B will always be correct. > > for example: >

Re: Sorting by item_in_another_list

2006-10-23 Thread Paul Rubin
Cameron Walsh <[EMAIL PROTECTED]> writes: > for example: > > A = [0,1,2,3,4,5,6,7,8,9,10] > B = [2,3,7,8] > > desired_result = [2,3,7,8,0,1,4,5,6,9,10] How about: desired_result = B + sorted(x for x in A if x not in B) -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting by item_in_another_list

2006-10-23 Thread Cameron Walsh
Paul McGuire wrote: > "Cameron Walsh" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Hi, >> >> I have two lists, A and B, such that B is a subset of A. >> >> I wish to sort A such that the elements in B are at the beginning of A, >> and keep the existing order otherwise, i.e. st

Re: Sorting by item_in_another_list

2006-10-23 Thread Paul McGuire
"Cameron Walsh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have two lists, A and B, such that B is a subset of A. > > I wish to sort A such that the elements in B are at the beginning of A, > and keep the existing order otherwise, i.e. stable sort. The order of > el

Re: Sorting by item_in_another_list

2006-10-23 Thread Cameron Walsh
Cameron Walsh wrote: > Hi, > > I have two lists, A and B, such that B is a subset of A. > > I wish to sort A such that the elements in B are at the beginning of A, > and keep the existing order otherwise, i.e. stable sort. The order of > elements in B will always be correct. > > for example:

Re: Obtaining SSL certificate info from SSL object - BUG?

2006-10-23 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > Is there a workaround for this? Without rebuilding Python > and becoming incompatible? I've parsed certs by calling openssl in a subprocess. Maybe that's not what you wanted to hear. If you're really industrious you might be able to extend the tlslite ce

Sorting by item_in_another_list

2006-10-23 Thread Cameron Walsh
Hi, I have two lists, A and B, such that B is a subset of A. I wish to sort A such that the elements in B are at the beginning of A, and keep the existing order otherwise, i.e. stable sort. The order of elements in B will always be correct. for example: A = [0,1,2,3,4,5,6,7,8,9,10] B = [2,3,

Obtaining SSL certificate info from SSL object - BUG?

2006-10-23 Thread John Nagle
The Python SSL object offers two methods from obtaining the info from an SSL certificate, "server()" and "issuer()". The actual values in the certificate are a series of name/value pairs in ASN.1 binary format. But what "server()" and "issuer()" return are strings, with the pairs separated by

Re: Arrays? (Or lists if you prefer)

2006-10-23 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Interesting. Could I do . . . let's say > > > > b = [range(range(3)] > > > > for a three-dimensional array? > > >>> [range(range(3))] > Traceback (most recent call last): >File "", line 1, in > TypeError: range() integer end argument expe

Re: Trouble with property

2006-10-23 Thread Ben Finney
"Odalrick" <[EMAIL PROTECTED]> writes: > Gabriel Genellina skrev: > > > You must use a new-style class for properties to work. That is: > > class ConstrainedBox(object): > > Thank you, I've seen it mentioned, but never knew what it meant. More generally, a "new-style class" is important in this i

RELEASED Python 2.3.6, release candidate 1

2006-10-23 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm announcing the release of Python 2.3.6 (release candidate 1). Python 2.3.6 is a security bug-fix release. While Python 2.5 is the latest version of Python, we're making this release for people who are still running Python 2.3.

Re: Negative integers and string formating

2006-10-23 Thread Steven D'Aprano
On Mon, 23 Oct 2006 18:56:21 -0700, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> def display(**kwargs): >> fs = format(kwargs['argument']) >> return fs % kwargs > > def display(**kwargs): > fs = format(kwargs['argument']) > return fs % dict((x, abs(y)) for

Network Simulator in Python

2006-10-23 Thread Daniel
Hi, I was wondering if anybody can give me pointers on an existing network simulator in Python somthing like ns2 which would model all the real world internet dynamics including TCP stacks, congestion, flow control etc. Every help is appreciated, Thanks -- http://mail.python.org/mailman/listin

Re: Python segmentation fault?

2006-10-23 Thread Klaas
Michael B. Trausch wrote: > Is there a way to debug scripts that cause segmentation faults? I can > do a backtrace in gdb on Python, but that doesn't really help me all > that much since, well, it has nothing to do with my script... :-P Yes. If you think it is a python interpreter bug, create a

Re: Python thread stack size

2006-10-23 Thread Chetan
The default thread allocated in for pthread is 32K if the system default is lower (it is 16K on my system). If the system default is higher, it is used. -Chetan -- http://mail.python.org/mailman/listinfo/python-list

Re: Negative integers and string formating

2006-10-23 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > def display(**kwargs): > fs = format(kwargs['argument']) > return fs % kwargs def display(**kwargs): fs = format(kwargs['argument']) return fs % dict((x, abs(y)) for x,y in kwargs.iteritems()) -- http://mail.python.org/mailman/listi

Re: Negative integers and string formating

2006-10-23 Thread Brett Hoerner
Steven D'Aprano wrote: > Are there any string formatting codes that will place a space between the > sign and the number? Not that I know of, why not use the absolute value (after checking if it is negative), In [1]: abs(-1) Out[1]: 1 -- http://mail.python.org/mailman/listinfo/python-list

Negative integers and string formating

2006-10-23 Thread Steven D'Aprano
Problem: I have an application where I need to print integers differently depending on whether they are positive or negative. To be more specific, I have to print something that looks like: "something + 1" "something - 1" Note the space between the sign and the number. If I didn't need that spac

Re: Trouble with property

2006-10-23 Thread Odalrick
Gabriel Genellina skrev: > You must use a new-style class for properties to work. That is: class > ConstrainedBox(object): > > -- > Gabriel Genellina > Softlab SRL > Thank you, I've seen it mentioned, but never knew what it meant. /Odalrick -- http://mail.python.org/mailman/listinfo/python-li

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Gabriel Genellina
At Monday 23/10/2006 21:02, Lucas wrote: http://www.pythonware.com/library/pil/handbook/image.htm im.load() said > > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > > know why they wrote that?! It clearly states that this syntax applies only to version 1.1.6 - and

pytho servlet engine

2006-10-23 Thread makerjoe
hi, all i would like to know which is the best PSE i have to choose to use servlets with mod_python in my HRYDROGEN project (http://makerjoe.sytes.net/pycrud/query.psp) thanks in advance makerjoe -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with property

2006-10-23 Thread Gabriel Genellina
At Monday 23/10/2006 20:28, Odalrick wrote: I'm having some trouble with using property. This class is supposed to represent a rectangle that can never be outside an area. class ConstrainedBox: # The property that is causing grief linear_size = property( _get_linear_size, _set_linear_si

https client certificate validation

2006-10-23 Thread Yogesh Chawla - PD
Hello All, I work for the State of Wisconsin and we are trying to build a reference implementation using python. Our goals are this: 1) establish an HTTPS connection between our client and ourselves 2) exchange client and server certificates to perform mutual authentication We only need to writ

Re: pretty basic instantiation question

2006-10-23 Thread Steven D'Aprano
On Mon, 23 Oct 2006 17:36:14 -0700, meithamj wrote: [fixing top-posting] > [EMAIL PROTECTED] wrote: >> i'm very new to python, but i have a pretty basic question: >> let's say i have a class, and i need to create a different number of >> instances (changes every time - and i can't know the number

Re: Python segmentation fault?

2006-10-23 Thread Paul Rubin
"Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> writes: > Is there a way to debug scripts that cause segmentation faults? I can > do a backtrace in gdb on Python, but that doesn't really help me all > that much since, well, it has nothing to do with my script... :-P Scripts should never caus

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread myeates
Well, compiling Python 2.5 on Solaris 10 on an x86 is no walk in the park. pyconfig.h seems to think SIZEOF_LONG is 4 and I SEGV during my build, even after modifying the Makefile and pyconfig.h. Mathew Martin v. Löwis wrote: > [EMAIL PROTECTED] schrieb: > > Anyone ever done this? It looks like P

Python segmentation fault?

2006-10-23 Thread Michael B. Trausch
Is there a way to debug scripts that cause segmentation faults? I can do a backtrace in gdb on Python, but that doesn't really help me all that much since, well, it has nothing to do with my script... :-P Any ideas? Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi > Anyone ever done this? It looks like Python2.4 won't take a length arg > > 2 Gig since its not seen as an int. Looking at Python's source (mmapmodule.c), it seems that "mmap.mmap" always sets the offset argument in Windows' MapViewOfFile and UNIX' mmap to 0. This m

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi > Anyone ever done this? It looks like Python2.4 won't take a length arg > > 2 Gig since its not seen as an int. Looking at Python's source (mmapmodule.c), it seems that "mmap.mmap" always sets the offset argument in Windows MapViewOfFile and UNIX to 0. This means th

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi > Anyone ever done this? It looks like Python2.4 won't take a length arg > > 2 Gig since its not seen as an int. Lookin at Python's source (mmapmodule.c), it seems that "mmap.mmap" always sets the offset argument in Windows MapViewOfFile and UNIX to 0. This means tha

Re: pretty basic instantiation question

2006-10-23 Thread meithamj
Why do you need to know the number of instances. I know that Python does not support Class Variable, but you can always create a global variable and increase it whenever you add a new instance. this will keep a record for you of how many instances you have. [EMAIL PROTECTED] wrote: > i'm very new

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
Martin v. Löwis wrote: > What architecture are you on? On a 32-bit architecture, it's likely > impossible to map in 2GiB, anyway (since it likely won't fit into the > available address space). Indeed. But why does Python's memory mapping need to be flushed? And why doesn't Python's mmap take an

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Anyone ever done this? It looks like Python2.4 won't take a length arg http://docs.python.org/lib/module-mmap.html It seems that Python does take a length argument, but not an offset argument (unlike the Windows' CreateFileMapping/MapViewOfFile and UNIX' mmap), so you

Re: pretty basic instantiation question

2006-10-23 Thread Steve Holden
Leif K-Brooks wrote: > [EMAIL PROTECTED] wrote: > >>let's say i have a class, and i need to create a different number of >>instances (changes every time - and i can't know the number in advance) in >>a loop. >>a function receives the number of instances that are needed, and creates >>them like, >>

Re: numpy error

2006-10-23 Thread Travis E. Oliphant
Juergen Kareta wrote: > Hello, > > this is my first try to get wxmpl-1.2.8 running. Therefor I installed: > > python 2.5 > matplotlib-0.87.6.win32-py2.5.exe > numpy-1.0rc3.win32-py2.5.exe > > on WinXP SP2 > > The result is a version mismatch (see below). > > Numpy version 102 seems to be n

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
http://www.pythonware.com/library/pil/handbook/image.htm im.load() said Leif K-Brooks wrote: > Lucas wrote: > > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > > know why they wrote that?! > > What tutorial? Where does it say that? -- http://mail.python.org/mailman/li

Re: classroom constraint satisfaction problem

2006-10-23 Thread Steven Bethard
Carl Banks wrote: > Steven Bethard wrote: >> Basically, I want to build groups of two teachers and four students such >> that [1]: >> >> * Students are assigned to exactly one group >> * Teachers are assigned to approximately the same number of groups >> * Students are not in groups with their home

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread Travis E. Oliphant
Martin v. Löwis wrote: > [EMAIL PROTECTED] schrieb: >> Anyone ever done this? It looks like Python2.4 won't take a length arg >>> 2 Gig since its not seen as an int. > > What architecture are you on? On a 32-bit architecture, it's likely > impossible to map in 2GiB, anyway (since it likely won't

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Leif K-Brooks
Lucas wrote: > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > know why they wrote that?! What tutorial? Where does it say that? -- http://mail.python.org/mailman/listinfo/python-list

Re: Help: Python2.3 & Python2.4 on RHEL4 x86_64

2006-10-23 Thread Christopher Taylor
Ok, so if I need to build the 32bit binaries, I just need to make sure I pass the right argument through to the compiler then? (I'm trying to build 32 bit and 64 bit binaries on the same system, but I'll wait untill I get just the 64bit stuff built first before I tackle that) Also, I've fooled a

Re: pretty basic instantiation question

2006-10-23 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > let's say i have a class, and i need to create a different number of > instances (changes every time - and i can't know the number in advance) in > a loop. > a function receives the number of instances that are needed, and creates > them like, > a=Myclass() > b=Myclass()

pretty basic instantiation question

2006-10-23 Thread sittner
i'm very new to python, but i have a pretty basic question: let's say i have a class, and i need to create a different number of instances (changes every time - and i can't know the number in advance) in a loop. a function receives the number of instances that are needed, and creates them like, a=M

Re: Customize the effect of enumerate()?

2006-10-23 Thread Dustan
Fredrik Lundh wrote: > "Dustan" wrote: > > > Except that my program is supposed to be treated as a module with tools > > to do certain things. I certainly can't control whether a 3rd party > > programmer uses "import myModule" or "from myModule import *". > > anything can happen if people use "from

Re: Socket module bug on OpenVMS

2006-10-23 Thread Irmen de Jong
Martin v. Löwis wrote: > Irmen de Jong schrieb: >> In my opinion Python's socket module itself could implement these >> workarounds. That would make user code a lot cleaner and less >> error prone, and more portable. What do other people think? > > It depends: when VMS defines MSG_WAITALL, but doe

Trouble with property

2006-10-23 Thread Odalrick
I'm having some trouble with using property. This class is supposed to represent a rectangle that can never be outside an area. I'll snip the parts I don't think are relevant. Or should I? I dunno. class ConstrainedBox: def __init__( self, size, ratio ): # Various instance va

Re: invert or reverse a string... warning this is a rant

2006-10-23 Thread DaveM
On Thu, 19 Oct 2006 20:07:27 -0400, Brad <[EMAIL PROTECTED]> wrote: >It has been my experience that Python has discouraging forums with >someone always calling someone else an idiot or telling them they are >awful in some way. I love Python, but the community is way too negative, >uptight and

Re: python class instantiation

2006-10-23 Thread Paul McGuire
"Éric Daigneault" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It is humbling to see how simple yet powerfull python`s view on things > is +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: multythreading app memory consumption

2006-10-23 Thread Neil Hodgson
Roman Petrichev: > Dennis Lee Bieber wrote: >> How much stack space gets allocated for 150 threads? > Actually I don't know. How can I get to know this? On Linux, each thread will often be allocated 10 megabytes of stack. This can be viewed and altered with the ulimit command. Neil -

Re: python class instantiation

2006-10-23 Thread Gabriel Genellina
At Monday 23/10/2006 17:56, Éric Daigneault lists wrote: >When creating a class with data members but no __init__ method. Python >deals differently with data members that are muatable and immutables. See specially items 4 and 5. And

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
:) 1)I just copy the tutorial to run "print pix[44,55]". I really dont know why they wrote that?! 2) i think putpixel((44, 55), (0, 0, 0)) and putpixel((44,55),0) is same. thank you again. I think I have solved my problem. Steve Holden wrote: > Lucas wrote: > > Thank you for your answer. > >

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > Anyone ever done this? It looks like Python2.4 won't take a length arg >> 2 Gig since its not seen as an int. What architecture are you on? On a 32-bit architecture, it's likely impossible to map in 2GiB, anyway (since it likely won't fit into the available address sp

Re: encoding of sys.argv ?

2006-10-23 Thread Martin v. Löwis
Jiba schrieb: > I use a Linux box, with French UTF-8 locales and an UTF-8 filesystem. > sys.getdefaultencoding() is "ascii" and sys.getfilesystemencoding() > is "utf-8". However, sys.argv is neither in ASCII (since I can pass > French accentuated character), nor in UTF-8. It seems to be encoded > i

Re: HTML Templates (Sitemesh/Tiles concept) in Python

2006-10-23 Thread grahamd
Suren wrote: > > Python with ? CGI ? FastCGI ? mod_python ? Other ? > > We are using mod_python and SSI. We are inheriting some legacy code > that we do not want to mess with at all. If you are already using SSI for basic page composition using 'include virtual', it may be of interest for you to k

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-23 Thread Ben Finney
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Méta-MCI wrote: > > For the professional developments, it is a major risk. > > some days, I ask myself why I shouldn't just use GPL for everything > I do, and ship it as source code only. Many popular programs *do* ship as source only, and leave it to t

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-23 Thread Martin v. Löwis
Georg Brandl schrieb: > Perhaps you can bring up a discussion on python-dev about your improvements > and how they could be integrated into the standard library... Let me second this. The compiler package is largely unmaintained and was known to be broken (and perhaps still is). A replacement impl

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Steve Holden
Lucas wrote: > Thank you for your answer. > > I have some new questions: > > 1) the value of return from getpixel() is a RGB number? > print im.getpixel((44,55)) > (160,160,160) > Yes, that's an RGB tuple. > 2) I want to put a number into the picture for encryption(replace least

Re: Help: Python2.3 & Python2.4 on RHEL4 x86_64

2006-10-23 Thread Martin v. Löwis
Christopher Taylor schrieb: > I had /usr/lib64/python2.3 included and that's why it was breaking. I > took it out and it works fine now. Unfortunately, it still puts the > lib files in /usr/lib instead of /usr/lib64. I'm assuming all I need > to do is set libdir accordingly and the files will ge

Re: Socket module bug on OpenVMS

2006-10-23 Thread Martin v. Löwis
Irmen de Jong schrieb: > In my opinion Python's socket module itself could implement these > workarounds. That would make user code a lot cleaner and less > error prone, and more portable. What do other people think? It depends: when VMS defines MSG_WAITALL, but doesn't implement it correctly, the

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Lucas
Thank you for your answer. I have some new questions: 1) the value of return from getpixel() is a RGB number? print im.getpixel((44,55)) > (160,160,160) 2) I want to put a number into the picture for encryption(replace least significant bit (LSB) of image intensity with message b

Re: Socket module bug on OpenVMS

2006-10-23 Thread Irmen de Jong
Fredrik Lundh wrote: > Irmen de Jong wrote: > >> This also raises the question to what extent Python itself should >> work around platform specific "peculiarities", such as this one. >> There's another problem with socket code on Windows and VMS systems, >> where you get strange exceptions when us

Re: python class instantiation

2006-10-23 Thread Chetan
Éric Daigneault wrote: >Got a question for you all... > >I noticed a behaviour in python class creation that is strange, to say the >least. > >When creating a class with data members but no __init__ method. Python deals >differently with data members that are muatable and immutables. > >Ex: >class

using mmap on large (> 2 Gig) files

2006-10-23 Thread myeates
Hi Anyone ever done this? It looks like Python2.4 won't take a length arg > 2 Gig since its not seen as an int. Mathew -- http://mail.python.org/mailman/listinfo/python-list

Re: python2.5 importerror on md5

2006-10-23 Thread samn
Chris Lambacher wrote: > On Mon, Oct 23, 2006 at 01:28:46PM -0700, samn wrote: > > i think the problem is different versions of openssl on the two > > machines , 0.9.7a and 0.9.8b > I second that this is the likely culprit. I got bit by it while trying to > do cross compile. The module build pro

Re: Attempting to parse free-form ANSI text.

2006-10-23 Thread Michael B. Trausch
Frederic Rentsch wrote: > Michael B. Trausch wrote: >> Alright... I am attempting to find a way to parse ANSI text from a >> telnet application. However, I am experiencing a bit of trouble. >> [snip] > > *I have no experience with reading from TCP/IP. But looking at your > program with a candid mi

Re: numpy error

2006-10-23 Thread Terry Reedy
numpy questions may get answered sooner and more dependably on the numpy mailing list. -- http://mail.python.org/mailman/listinfo/python-list

Re: mean ans std dev of an array?

2006-10-23 Thread Tim Chase
> import array > a = array.array('f', [1,2,3]) > print a.mean() > print a.std_dev() > > Is there a way to calculate the mean and standard deviation on array > data? > > Do I need to import it into a Numeric Array to do this? No, you don't have to...though there are likely some stats modules flo

Re: mean ans std dev of an array?

2006-10-23 Thread Paul Rubin
"SpreadTooThin" <[EMAIL PROTECTED]> writes: > print a.mean() > print a.std_dev() > > Is there a way to calculate the mean and standard deviation on array data? Well, you could use numpy or whatever. If you want to calculate directly, you could do something like (untested): n = len(a) mean = sum

Re: Attempting to parse free-form ANSI text.

2006-10-23 Thread Michael B. Trausch
Jean-Paul Calderone wrote: > On Sun, 22 Oct 2006 00:34:14 -0400, "Michael B. Trausch" > wrote: >> Alright... I am attempting to find a way to parse ANSI text from a >> telnet application. However, I am experiencing a bit of trouble. >> >> What I want to do is have all ANSI sequences _removed_ fro

Re: mean ans std dev of an array?

2006-10-23 Thread Éric Daigneault lists
Simplest I see is to do it manually. If your array data is numeric compatible mean = sum(a)/len(a) as for the standard Deviation it depends on the nature of your data... check out http://en.wikipedia.org/wiki/Standard_deviation for info on that... but in all a for loop with a few calculati

Re: python class instantiation

2006-10-23 Thread Éric Daigneault
Fredrik Lundh wrote: > Éric Daigneault lists wrote: > > >> When creating a class with data members but no __init__ method. Python >> deals differently with data members that are muatable and immutables. >> > > no, it doesn't. it's your code that deals with them in different ways, > not

mean ans std dev of an array?

2006-10-23 Thread SpreadTooThin
import array a = array.array('f', [1,2,3]) print a.mean() print a.std_dev() Is there a way to calculate the mean and standard deviation on array data? Do I need to import it into a Numeric Array to do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a Python-on-Windows person to help with SpamBayes

2006-10-23 Thread skip
>> The bare requirements are: >> >> * Able to program in Python on Windows (that is, remove my Unix-think >> from the OCR bits of code) >> >> * Use Outlook to read mail (so you can test the changes with the >> SpamBayes Outlook plugin) George> Does "remove my uni

Re: python2.5 importerror on md5

2006-10-23 Thread Chris Lambacher
On Mon, Oct 23, 2006 at 01:28:46PM -0700, samn wrote: > i think the problem is different versions of openssl on the two > machines , 0.9.7a and 0.9.8b I second that this is the likely culprit. I got bit by it while trying to do cross compile. The module build process assumes a couple of locations

Re: Getting a lot of SPAM from this list

2006-10-23 Thread skip
Gabriel> I use a discardable email address from Yahoo. Spam filtering is Gabriel> good, and when you get too much spam, just delete that address Gabriel> and create another one. Maybe it's just me, but creating and discarding email addresses makes me think the spammers have won. I'd

Re: encoding of sys.argv ?

2006-10-23 Thread Leo Kislov
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Jiba wrote: > > > I am desperately searching for the encoding of sys.argv. > > > > I use a Linux box, with French UTF-8 locales and an UTF-8 filesystem. > > sys.getdefaultencoding() is "ascii" and sys.getfilesystemencoding() is > > "utf-8".

Re: Looking for a Python-on-Windows person to help with SpamBayes

2006-10-23 Thread George Sakkis
[EMAIL PROTECTED] wrote: > The bare requirements are: > > * Able to program in Python on Windows (that is, remove my Unix-think > from the OCR bits of code) > > * Use Outlook to read mail (so you can test the changes with the > SpamBayes Outlook plugin) Does "remove my unix-th

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Steve Holden
Lucas wrote: > I want to change some pixel value in the picture file. how to do it? > The most popular way is probably the Python Image Library, known to its friends as PIL: http://www.pythonware.com/products/pil/ You will see from http://www.pythonware.com/library/pil/handbook/image.htm

Re: encoding of sys.argv ?

2006-10-23 Thread Leo Kislov
Jiba wrote: > Hi all, > > I am desperately searching for the encoding of sys.argv. > > I use a Linux box, with French UTF-8 locales and an UTF-8 filesystem. > sys.getdefaultencoding() is "ascii" and sys.getfilesystemencoding() is > "utf-8". However, sys.argv is neither in ASCII (since I can pass

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-23 Thread Georg Brandl
Michael Spencer wrote: > Georg Brandl wrote: >> Michael Spencer wrote: >>> Announcing: compiler2 >>> - >>> >>> For all you bytecode enthusiasts: 'compiler2' is an alternative to the >>> standard >>> library 'compiler' package, with several advantages. >> >> Is this a rewrite

Re: python class instantiation

2006-10-23 Thread Fredrik Lundh
Éric Daigneault lists wrote: > When creating a class with data members but no __init__ method. Python > deals differently with data members that are muatable and immutables. no, it doesn't. it's your code that deals with them in different ways, not Python. > Ex: > class A(object): > stri

python class instantiation

2006-10-23 Thread Éric Daigneault lists
Got a question for you all... I noticed a behaviour in python class creation that is strange, to say the least. When creating a class with data members but no __init__ method. Python deals differently with data members that are muatable and immutables. Ex: class A(object): stringData = "W

Re: Getting a lot of SPAM from this list

2006-10-23 Thread Gabriel Genellina
At Monday 23/10/2006 16:13, [EMAIL PROTECTED], wrote: Does anyone have a suggestion as to a way that I can get less of this spam? I could have another I use a discardable email address from Yahoo. Spam filtering is good, and when you get too much spam, just delete that address and create

  1   2   3   >