Re: help please

2005-02-21 Thread rzed
"gargonx" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Even if i put it in exactly the way you did: > > >>> import re > >>> charmatcher = re.compile(r' [A-Z] [\d]?') > >>> > >>> ext = dict(D="V1", O="M1", G="S1") > >>> std = dict(S="H") > >>> > >>> decode_replacements ={} > >>> de

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread Diez B. Roggisch
> I've never understood the problem with long URLs. Many > newsreaders let you click on them. If not, you just cut/paste > it into a browser (with a shellscript a couple lines long, you > can start firefox with the URL on the X clipboard with a single > command). Some break the urls - so copy an

Re: lambda closure question

2005-02-21 Thread jfj
Carl Banks wrote: transformations gets rebound, so you'd need a reference to it. That certainly is an application. I guess it depends on one's programming background. I'd only use nested (function, class) definition to accomplish such a feature: def genclass(x,y): clas

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread Ilias Lazaridis
Nick Vargish wrote: Ilias Lazaridis <[EMAIL PROTECTED]> writes: Now it's really time to close this thread. I suspect this will fall of deaf ears, but I have to mention that you do not get to "close threads" on Usenet. this is obvious. You can excuse yourself from this one and stop replying to comm

Re: [ANN] Python 2.4 Quick Reference available

2005-02-21 Thread TZOTZIOY
On Sun, 20 Feb 2005 14:57:14 +, rumours say that Michael Hoffman <[EMAIL PROTECTED]> might have written: [snip: use 'open' in preference to 'file'] >To be honest I doubt open will be extended in this manner. I can see >the Pythoneers adding, say, a keyword argument to open to allow a URL >ins

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread Grant Edwards
On 2005-02-20, Nick Vargish <[EMAIL PROTECTED]> wrote: > "BrainDead" <[EMAIL PROTECTED]> writes: > >> I believe that you are wasting your time. Looking at your email >> address, this may well be relevant. > [ 4-line URL snipped ] > > Thanks for the historical reference. Please consider a visit t

Re: Article on Hi-Fi Myths

2005-02-21 Thread Grant Edwards
On 2005-02-21, Mike Meyer <[EMAIL PROTECTED]> wrote: >> "you just need to know what techniques to use to create a >> 'friendly', 'relaxing', energy pattern." > > I find that playing back Python code over multi-stranded copper > produces the best results. Only if you color the edges with

Re: lambda closure question

2005-02-21 Thread Diez B. Roggisch
> I have the impression that you misunderstood me. I'm not after a > side-effect free language. I just think python could be nicer in > allowing some side-effects. Yeah, seems as if I somehow added an inadvertent "not" somewhere in my train of thoughts while reading (and hopfully comprehending...)

Re: lambda closure question

2005-02-21 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> It's not only that way in python, but in java too. So it seems that there >> is a fundamental principle behind it: In a language that allows >> sideeffects, these will actually happen. > > Can you even have nested functions in

Re: Platform independent adduser script?

2005-02-21 Thread Gustavo Rahal
Hi On redhat you can use a libuser module that provides some highlevel system tasks. redhat-tools use this module all the time.. look at some sources Gustavo morphex wrote: Hi there, does anyone here know of a script that enables adding of users on UNIX platforms via python? Thanks, Morten -- htt

Re: recommended way of generating HTML from Python

2005-02-21 Thread Matt Goodall
On Mon, 2005-02-21 at 07:36 -0500, Kent Johnson wrote: > Michele Simionato wrote: > > The problem is a problem of standardization, indeed. There plenty of > > recipes to > > do the same job, I just would like to use a blessed one (I am teaching > > a Python > > course and I do not know what to reco

Re: lambda closure question

2005-02-21 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > It's not only that way in python, but in java too. So it seems that there is > a fundamental principle behind it: In a language that allows sideeffects, > these will actually happen. Can you even have nested functions in Java? Algol-60 did things t

Detecting the change of screen resolution with SDL or PyGame

2005-02-21 Thread Erik Bethke
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the desktop resolution. I have tried trapping the following events: 1) SDL_ACTIVEEVENT 2) SDL_VIDEOEXPOSE 3

Re: lambda closure question

2005-02-21 Thread Antoon Pardon
Op 2005-02-21, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: >> But I'll get back at what seems you actually wanted to say: >> That there is no way to rebind 'x' or in my case 'l' and >> with that I have to agree although I personnaly find that >> a lack in python > > It's not only that way in pyth

Yet Another BLT/TkInter Install Question

2005-02-21 Thread Noelle QUEMENER
I have just installed BLT: I effectively had some problems - the same you had. I found this: Python GUI Setup Here is the procedure I used to get "Fourier" working on Windows and Linux. I wanted to use BLT for xy-plotting, partly because we used it with tcl in the sss project, and partly becaus

Re: segfault when calling Python from C thread

2005-02-21 Thread Greg Chapman
Fredrik Lundh wrote: > Greg Chapman wrote: > > > Your callback function needs to hold the Python GIL (and have a > > vaild threadstate) before it calls any Python C-API functions. > > Change the last part of it to: > > > >PyGILState_STATE state; > > > >/* ... */ > > > >/* Time to c

Re: python2.4 generator expression > python2.3 list expression

2005-02-21 Thread TZOTZIOY
On 21 Feb 2005 06:48:19 -0500, rumours say that Dan Sommers <[EMAIL PROTECTED]> might have written: [snip: snacktime posts code to count bits] >> Seems to work, is there a better way to do this? [Dan] >for c in range( 128 ): >even_odd = 0 >print '%3d' % c, >while c: >c &= c -

Tiled Image viewer

2005-02-21 Thread Ian McConnell
Does anyone know of a widget or sample code for viewing huge (ie bigger than RAM) images in python? The usual way of doing this is to read part of the image into memory as a set of tiles and then zoom and pan the tiles. The sort of thing I'm trying to achive is at http://iipimage.sourceforge.

Re: lambda closure question

2005-02-21 Thread Duncan Booth
Antoon Pardon wrote: > But I'll get back at what seems you actually wanted to say: > That there is no way to rebind 'x' or in my case 'l' and > with that I have to agree although I personnaly find that > a lack in python 'no way' is a bit strong. You can use hacks such as the one I posted a coup

Re: lambda closure question

2005-02-21 Thread Diez B. Roggisch
> But I'll get back at what seems you actually wanted to say: > That there is no way to rebind 'x' or in my case 'l' and > with that I have to agree although I personnaly find that > a lack in python It's not only that way in python, but in java too. So it seems that there is a fundamental princip

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread JanC
Nick Vargish schreef: > Please consider a visit to > tinyurl.com before posting a monster like that... :^) As long as he also posts the full URL... -- JanC "Be strict when sending and tolerant when receiving." RFC 1958 - Architectural Principles of the Internet - section 3.9 -- http://mail.py

Re: lambda closure question

2005-02-21 Thread Antoon Pardon
Op 2005-02-21, jfj schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-02-19, jfj schreef <[EMAIL PROTECTED]>: >> >>>once foo() returns there is no way to modify 'x'! >>>It becomes a kind of constant. >> >> >> In this particular case yes. But not in general, what about >> this: >> >>

Re: recommended way of generating HTML from Python

2005-02-21 Thread Kent Johnson
Michele Simionato wrote: The problem is a problem of standardization, indeed. There plenty of recipes to do the same job, I just would like to use a blessed one (I am teaching a Python course and I do not know what to recommend to my students). Why not teach your students to use a template system?

Re: lambda closure question

2005-02-21 Thread jfj
Antoon Pardon wrote: Op 2005-02-19, jfj schreef <[EMAIL PROTECTED]>: once foo() returns there is no way to modify 'x'! It becomes a kind of constant. In this particular case yes. But not in general, what about this: def F(): ... l = [] ... def pop(): ... return l.pop() ... def push(e):

Re: intersection of 2 list of pairs

2005-02-21 Thread Pierre Quentel
Another method is to build two sets of sets, one for E1 and one for E2, then make the intersection of these sets - with Python 2.3 >>> E1=[('a','g'),('r','s')] >>> E2=[('g','a'),('r','q'),('f','h')] >>> from sets import Set,ImmutableSet >>> f=Set([ImmutableSet(s) for s in E1])& Set([ImmutableSet(

Re: How Do I get Know What Attributes/Functions In A Class?

2005-02-21 Thread Kent Johnson
Hans Nowak wrote: [EMAIL PROTECTED] wrote: Hi, I'm new to python. Given a class, how can I get know what attributes/functins in it without dig into the source? Use the dir function: >>> from smtplib import SMTP >>> dir(SMTP) ['__doc__', '__init__', '__module__', 'close', 'connect', 'data', 'de

Re: functions and named keyword arguments

2005-02-21 Thread Diez B. Roggisch
> Sorry if this is a duplicate - I use the google interface and sometiems > it screws up (not showing stuff you've posted *or* not posting it). > Before you ask it's because at work I have no NNTP and *heavily* > restricted http. It is - so I requote my answer :) Im not sure if I understand you

Re: lambda closure question

2005-02-21 Thread Antoon Pardon
Op 2005-02-19, jfj schreef <[EMAIL PROTECTED]>: > Carl Banks wrote: >> Ted Lilley wrote: >> >> >>>Unfortunately, it doesn't work. It seems the closure keeps track of >>>the variable fed to it dynamically - if the variable changes after >> [...] >>> >>>At least, that's the explanation I'm deduci

Re: gui scripting

2005-02-21 Thread Simon Brunning
On 17 Feb 2005 04:48:19 -0800, Tonino <[EMAIL PROTECTED]> wrote: > thanks - am already involved in a process to modify winguiauto.py - > this is a GREAT start but we need more control and better handleing ;) Can you be more specific? > Thanks for the WATSUP site - will check on this as well ;)

functions and named keyword arguments

2005-02-21 Thread Fuzzyman
Sorry if this is a duplicate - I use the google interface and sometiems it screws up (not showing stuff you've posted *or* not posting it). Before you ask it's because at work I have no NNTP and *heavily* restricted http. A colleague and I have built a Validator object for use with ConfigObj and o

Re: Keyword Named Args

2005-02-21 Thread Diez B. Roggisch
> What I can't easily see is any way of passing named keyword arguments > to the function. Suppose we wanted to pass keyword=param to a function > - is there any way of doing this ... obviously passing in > 'keyword=param' as text has entirely the wrong result.. Im not sure if I understand you

Re: combining several lambda equations

2005-02-21 Thread Antoon Pardon
Op 2005-02-18, Steven Bethard schreef <[EMAIL PROTECTED]>: > Paddy McCarthy wrote: >> x=lambda : A < B >> y=lambda : C+6 >= 7 >> > [snip] >> >> Z=lambda : (A=7) > > See "Inappropriate use of Lambda" in > http://www.python.org/moin/DubiousPython > > Perhaps your real example is different, but notice

Re: python2.4 generator expression > python2.3 list expression

2005-02-21 Thread Dan Sommers
On Sun, 20 Feb 2005 20:56:52 -0800, snacktime <[EMAIL PROTECTED]> wrote: > I need to convert a generator expression to a list expression so it > will work under python 2.3. > I rewrote this: > for c in range(128): > even_odd = (sum(bool(c & 1< As this: > for c in range(128): > bo = [bool(c

Re: lambda closure question

2005-02-21 Thread Carl Banks
jfj wrote: > The costly extra feature is this: > ### > def foo(): > def f(): > print x > x=1 > f() > x=2 > f() > return f > foo()() > # > which prints '1 2 2' > > The fractal code runs a little _slower_ because of this ability. > Alth

Keyword Named Args

2005-02-21 Thread Fuzzyman
A colleague and I have built a Validator object for use with ConfigObj and other general schema situations. A config file is used to store a schema that specifies how to test a value that it is valid. keyword=function(param1, param2) e.g. you could specify : size = range(30, 50) This means that

Re: lambda closure question

2005-02-21 Thread Carl Banks
Mike Meyer wrote: > "Carl Banks" <[EMAIL PROTECTED]> writes: > > > Say you have a suite of functions, all of which are called by some main > > function and each other, and all of which need to access a lot of the > > same data. The best, most straightforward way to do it is to have the > > common

Re: unicode encoding usablilty problem

2005-02-21 Thread Fredrik Lundh
"aurora" <[EMAIL PROTECTED]> wrote: >> if you don't know what a and b comes from, how can you be sure that >> your program works at all? how can you be sure they're both strings? > > a and b are both string. how do you know that? >> if you have unit tests, why don't they include Unicode tests?

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread grahamd
> If you do manage to get mod_python working, I suggest taking a look at > Vampire as well: http://www.dscpl.com.au/projects/vampire/ > I have had good experience with it. Once you start using mod_python > you'll realize you can really go anywhere you want; and that's not > necessarily a good thing

Re: Don't understand global variables between modules

2005-02-21 Thread Fredrik Lundh
Bart wrote: > I don't understand globals between multiple modules in a python program. I > really don't. I've narrowed it down to the following two very simple > programs a.py and b.py. When I run a.py I get the following output: > > inc: 2 > A: 2 > inc: 3 > B: 3 > C: 1 > > I don't understand

MDaemon Warning - virus found: Returned mail: see transcript for details

2005-02-21 Thread Post Office
*** WARNING ** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. AttachmentVirus name Action taken ---

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread grahamd
Michal Migurski wrote: > 3) Structured request variables. PHP has a really handy feature where > request variables with name like "foo[]", "foo[bar]", or > "foo[bar][baz]" are automatically structured into nested associative > arrays. I can see that the python cgi module will make a list of > Min

Don't understand global variables between modules

2005-02-21 Thread Bart
Hi all I don't understand globals between multiple modules in a python program. I really don't. I've narrowed it down to the following two very simple programs a.py and b.py. When I run a.py I get the following output: inc: 2 A: 2 inc: 3 B: 3 C: 1 I don't understand the last line at all. Why

IDLE output too slow for practical use after upgrade from P2.2.2 to P2.4

2005-02-21 Thread Anthra Norell
Hi,    I upgraded from 2.2.2 to 2.4 and all is well except the output to the IDLE window is now twenty times slower than it was before, making the window utterly unusable for verbose output. The statement -- for i in range (100): print i -- now takes about forty-five seconds to complete! Used

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread bruno modulix
Ilias Lazaridis wrote: Should a professional developer take python serious? A *professionnal developper*, yes. But this is irrelevant to you. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread bruno modulix
Ilias Lazaridis wrote: Bruno Desthuilliers wrote: [...] closing thread http://groups-beta.google.com/group/comp.lang.python/msg/f2ae9cdbe16676d1 Nope. You are not entitled to close thread. This is irrelevant. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread bruno modulix
Michal Migurski wrote: The python-based zope application server has session management. Togther with a built-in user and access rights management. ... This can be done in zope if you name a variable :list. That then will give you the variable as list regardless of the number of occurences. Thank

Re: [PyGTK] Resizing a HandleBox

2005-02-21 Thread Robert Kern
Franck Pommereau wrote: Hi all, I'm using PyGTK-2.0.0, when I detach a HandleBox, the resizing of the newly created window is broken: it can be resized but it's content (the HandleBox and its child) is not affected at all and is not resized. Does any one have a solytion to this problem? I'm afra

[PyGTK] Resizing a HandleBox

2005-02-21 Thread Franck Pommereau
Hi all, I'm using PyGTK-2.0.0, when I detach a HandleBox, the resizing of the newly created window is broken: it can be resized but it's content (the HandleBox and its child) is not affected at all and is not resized. Does any one have a solytion to this problem? Thanks in advance! Franck -- htt

[PyGTK] forbid focus of TreeView columns

2005-02-21 Thread Franck Pommereau
Hi all, I'm building a PyGTK interface in which I would like that no widget would be able to get the focus (and so to be activated by pressing the Return key). For this purpose, for each widget, I do: widget.set_property("can-focus", gtk.FALSE) My problem is a TreeView which has a clickable

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread Fredrik Lundh
Joe Francia wrote: > You'll also want to probably look at some of the templating kits, of which > Cheetah and/or > ElementTree work best for me. (Well, ElementTree isn't exactly a templating > kit - it's a > general-purpose XML tookit - but it is easily used for templating.) if you want elem

Re: Test for structure

2005-02-21 Thread Martin Miller
Yes, both string and lists have a __getitem__ attribute: >>> c1 = 'abc' >>> c2 = ['de', 'fgh', 'ijkl'] >>> hasattr(c1, '__getitem__') True >>> hasattr(c2, '__getitem__') True In other words you could index elements of either one using []. Likewise, both a string and list would produce a usable i

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-21 Thread Ville Vainio
> "Mike" == Mike Meyer <[EMAIL PROTECTED]> writes: Mike> I've actually done some work on using CORBA as a COM for Mike> Unix (or, as I think of it, an ARexx for Unix). After being Mike> exposed to Plan 9, I've decided that's a better Mike> solution. CORBA has the advantage that

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-21 Thread Ville Vainio
> "Mike" == Mike Meyer <[EMAIL PROTECTED]> writes: Mike> IPython's pysh seems a little clumsy for interactive use, as Mike> it requires special characters to distinguish between Mike> commands to be passed to the shell and commands to be passed Mike> to the scripting language.

Re: python2.4 generator expression > python2.3 list expression

2005-02-21 Thread Peter Otten
snacktime wrote: > I need to convert a generator expression to a list expression so it > will work under python 2.3. > > I rewrote this: > > for c in range(128): > even_odd = (sum(bool(c & 1< > As this: > > for c in range(128): > bo = [bool(c & 1< even_odd = sum(bo) & 1 > > > Seems to

<    1   2