Pattern-match & Replace - help required

2012-12-19 Thread AT
Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string (basically an sql statement): stmnt = 'SELECT taxpayer.id, taxpayer.enc_name, taxpayer.age, taxpayer.occupation FROM

Re: Pattern-match & Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 15:51:22 UTC+5, Steven D'Aprano wrote: > On Wed, 19 Dec 2012 02:42:26 -0800, AT wrote: > > > > > Hi, > > > > > > I am new to python and web2py framework. Need urgent help to match a > > > pattern in an string

Re: Pattern-match & Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 16:27:19 UTC+5, Thomas Bach wrote: > On Wed, Dec 19, 2012 at 02:42:26AM -0800, AT wrote: > > > Hi, > > > > > > I am new to python and web2py framework. Need urgent help to match a > > > pattern in an string and replace th

Re: Pattern-match & Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 18:16:18 UTC+5, Peter Otten wrote: > AT wrote: > > > > > I am new to python and web2py framework. Need urgent help to match a > > > pattern in an string and replace the matched text. > > > > > > I've this

Conditional iteration

2006-12-13 Thread at
I would like to spark the discussion about the following syntax problem I encounter. THE PROBLEM I have a lot times the following code: for x in [-2, -1, 0, 1, 2, 3, 4]: if x > 0: ... more code... It is not the addional line containing 'if x > 0:' that bothers me, but

Re: Conditional iteration

2006-12-13 Thread at
x in some_list if some_condition: --- etc... I am not looking for a work around but more interest if other people might judge this syntax would come in handy? Interested in any feedback! Kind regards, @ Paul Rubin wrote: > at <[EMAIL PROTECTED]> writes: >> I

Re: Conditional iteration

2006-12-13 Thread at
ep. Unless of course nobody appreciates it. That's the discussion I'd like to have here in the forum. All the best @ Roberto Bonvallet wrote: > at wrote: >> More pythonic in view would be: >> >> for x in [-2, -1, 0, 1, 2, 3, 4] if x > 0: >>...

Re: Iterating over several lists at once

2006-12-13 Thread at
for" loop. > > Thanks for replying me. > > > On Dec 13, 3:58 pm, Roberto Bonvallet <[EMAIL PROTECTED]> > wrote: >> Gal Diskin wrote: >> > Hi, >> > I am writing a code that needs to iterate over 3 lists at the same >> >

Re: Conditional iteration

2006-12-13 Thread at
The proposed solution impairs readability because there's a "surprise" > at the end. List comprehensions already open the language up to > readability abuse. Lets not add more. > > To avoid the unwanted indentation, I would go with the already > suggested "if not x&g

Re: Conditional iteration

2006-12-13 Thread at
alternatives that don't do that. Does Guido ever change his mind? Cheers, @ Carl Banks wrote: > at wrote: >> I am not looking for a work around but more interest if other people >> might judge this syntax would come in handy? > > Of course people have expressed interest in

Re: Conditional iteration

2006-12-13 Thread at
My comments below. Kind regards, @ Carl Banks wrote: > at wrote: >> Well, all I can say that for me as a user it would make sense... > > Which is, like, step one out of a hundred for getting a syntax change > into the language. > >> Curiosity: in what sense is it

Re: Conditional iteration

2006-12-13 Thread at
Thanx Paul! Do you know if this generates a new list internally (memory consumption?) @ Paul Rubin wrote: > at <[EMAIL PROTECTED]> writes: >> You proposal, seems nice to me but it doesn't work with Python 2.4.3, >> should it work with 2.5? >> >> Again I

Re: Conditional iteration

2006-12-13 Thread at
xt thing I think is 'hm, not all of the list' and even worse should I worry if more restrictions can be found when I read further... All the best, @ greg wrote: > at wrote: > >> It is not the addional line containing 'if x > 0:' that bothers me, but >>

Re: Conditional iteration

2006-12-14 Thread at
}[condition] or a = [c, a][condition] would yield exactly the same even in one sentence Cheers, @ at wrote: > My comments below. > > Kind regards, > @ > > > Carl Banks wrote: > >> at wrote: >>> Well, all I can say that for me as a user it wo

Re: Conditional iteration

2006-12-14 Thread at
Hi Paul, I appreciate your explanation! Thanx @ Paul Rubin wrote: > at <[EMAIL PROTECTED]> writes: >> > for x in (x for x in [-2, -1, 0, 1, 2, 3, 4] if x > 0): >> >... more code ... > >> Do you know if this generates a new list internally

Re: Conditional iteration

2006-12-14 Thread at
Dear Diez, True, I was just mentioning a workaround for a typical case. Kind regards, Arjan Diez B. Roggisch wrote: >> Is it redundant according to your criteria, yes I would say: >> >> a = {True: a, False: c}[condition] >> >> or >> >> a = [c, a][condition] >> >> would yield exactly the sa

Re: Conditional iteration

2006-12-14 Thread at
consuming too much additional resources. Kind regards, Arjan Duncan Booth wrote: > at <[EMAIL PROTECTED]> wrote: > >> By the way, >> >> I think by approving >> >> a = b if condition else c >> >> used to avloind >> >> if condition

Re: Conditional iteration

2006-12-14 Thread at
I am not claiming that it was THE motivation, but it solves my problem... Carl Banks wrote: > > at wrote: >> By the way, >> >> I think by approving >> >> a = b if condition else c >> >> used to avloind >> >> if condition: >>

Re: 10 sec poll - please reply!

2012-11-20 Thread mherrmann . at
That's a very good suggestion Emile!! So I might eventually need both 'press' and 'release' (or press_key/release_key). Thanks for this! To everyone else who has been so kind to reply thus far: What do you think of generate_keystrokes? It's a bit long but describes exactly what the function wou

Jython but portable?

2020-07-19 Thread vjp2 . at
How do you use Jython Standalone Jar? Do you have to "Intall"? I usually use most standalone jars directly without intalling. And I want to use this thing in Portable Apps, so I din't want to install anything. Because it might end up in my Windows system and I won't kn

Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread mherrmann . at
tem, I think I'll have a hard time getting at this person. If I even manage to find out where the person is at all. -- https://mail.python.org/mailman/listinfo/python-list

Jython from bathc file?

2015-05-08 Thread vjp2 . at
How do I do this in a .bat file? Do I include the Jython or pipe it? % CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar; jython -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper Jython 2.2.1 on java1.6.0_20 Type "copyright", "credits" or "license" for more information.

Re: Jython from bathc file?

2015-05-09 Thread vjp2 . at
Thanks.. I suspected it wasn't meant to be taken as in the file THe one thing I'm not sure if Jython is suppsosedto keep running after the initisl stuff is loaded in.. To put the question in purely DOS terms if you run a program can you pipe it some commands and then keep it running to take the

Re: Jython from bathc file?

2015-05-09 Thread vjp2 . at
Tee from gnuutils?? - = - Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist http://www.panix.com/~vjp2/vasos.htm ---{Nothing herein constitutes advice. Everything fully disclaimed.}--- [Homeland Security mean

Re: Jython from bathc file?

2015-05-09 Thread vjp2 . at
I have to try this and see if there is ome kind of init file in jython/python sorta like autoexec.bat. Ialso have no idea if the commands they provide are all it takes to run the app or I have to stay in jython.. sorry, I'm thinking at loud.. ok, thanks t

Jython standalone

2015-11-13 Thread vjp2 . at
I click jython.org standalone jar and it just does a wait cycle. What does it need to give me a prompt? - = - Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist http://www.panix.com/~vjp2/vasos.htm ---{Nothing her

Re: Jython standalone

2015-11-14 Thread vjp2 . at
Jython is python in java at jython.org. I tried clicking and double clicking. I does a wait cycle (rotating arrow) then returns to attention. I'm trying to run RDKIT, an app written for jython. THen I realised jython wasn't working at all. I've had same problem with some jav

Problem using cx_Freeze

2022-08-15 Thread David at Booomer
I’m trying to use cx_Freeze (https://pypi.org/project/cx-Freeze/) in a python app but running into an error message: AttributeError: module 'cx_Freeze' has no attribute ‘BdistDMG’ I’m using Anaconda and error appears with the import command: from cx_Freeze import * From the terminal the comma

Re: Problem using cx_Freeze

2022-08-15 Thread David at Booomer
has self. Thanks, David > On Aug 15, 2022, at 5:51 PM, Jim Schwartz wrote: > > This link covers how to use BDist_dmg. > > https://cx-freeze.readthedocs.io/en/latest/setup_script.html > > Sent from my iPhone > >> On Aug 15, 2022, at 12:11 PM, David at Booomer

Re: Problem using cx_Freeze

2022-08-17 Thread David at Booomer
mention of adding self which is in these lines already. Previously I had search for __init__() which returned no lines due to the closing ). I had visited the page you provided (https://cx-freeze.readthedocs.io/en/latest/setup_script.html#cx-freeze-executable) but didn’t noticed the 11 plus self as 12

Re: Problem using cx_Freeze > auto-py-to-exe

2022-08-18 Thread David at Booomer
From: Dennis Lee Bieber > > On Wed, 17 Aug 2022 12:09:14 -0600, David at Booomer > declaimed the following: > >> executables=[ >> Executable( >> >> "prjui.py","Maiui.py","about.py","dict.py

Re: How to replace all None values with the string "Null" in a dictionary

2005-10-28 Thread bruno at modulix
dcrespo wrote: > Hi all, > > How can I replace all None values with the string 'Null' in a > dictionary? > > For example: > convert this: > a = {'item1': 45, 'item2': None} > > into this: > a = {'item1': 45, 'item2': 'Null'} > I think it would be time for you to read the Fine Manual... for ke

Re: data hiding/namespace pollution

2005-10-31 Thread bruno at modulix
Alex Hunsley wrote: > There's no really specific questions in this post, but I'm looking for > people's thought on the issues within... > > > The two main versions I've encountered for data pseudo-hiding > (encapsulation) Hmmm... Are data-hiding and encapsulation really the same things ? > i

Re: data hiding/namespace pollution

2005-10-31 Thread bruno at modulix
Alex Hunsley wrote: > bruno at modulix wrote: > >> Alex Hunsley wrote: >> (snip) >>> >>> method 1: >>> >>> _X - (single underscore) - just cosmetic, a convention to let someone >>> know that this data should be private. >&g

Re: 'super' to only be used for diamond inheritance problems?

2005-10-31 Thread bruno at modulix
Alex Hunsley wrote: > I've seen a few discussion about the use of 'super' in Python, including > the opinion that 'super' should only be used to solve inheritance > diamond problem. (And that a constructor that wants to call the > superclass methods should just call them by name and forget about su

Re: About the Python Expert

2005-11-02 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > Hey, i didnt say i need an expert. wel i did... anyways, i m just > saying that Fan is not a good python programmer, he doesnt know enough > python to help those who have joined his group, i know its askin a > lot, and i m not askin for a private tutor, just someone(s)

Re: expanding dictionary to function arguments

2005-11-02 Thread bruno at modulix
Noah wrote: > Bruno Desthuilliers a écrit : > >>Noah a écrit : >>If you have control over the API functions declarations, makes them so: >>def my_api_func(arg1='', arg2='whatever', **kwargs): >> code_here > > > Unfortunately I cannot change the API functions. > I should have mentioned that. Y

Re: when and how do you use Self?

2005-11-03 Thread bruno at modulix
Tieche Bruce A MSgt USMTM/AFD wrote: > I am new to python, > > > > Could someone explain (in English) how and when to use self? > Don't use self. Use other. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -

Re: how to write a blog system with Python

2005-11-03 Thread bruno at modulix
ice wrote: > I am a fresh here , and I have no idea of it. > Do you have any comments? > Learn Python Learn web programming Write the specs for your blog system Design the solution Implement it -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '

Re: when and how do you use Self?

2005-11-03 Thread bruno at modulix
Chris Cioffi wrote: as a point of style, top-posting is a Bad Thing(tm) (fixed) > > On 03/11/05, bruno at modulix <[EMAIL PROTECTED]> wrote: > >>Tieche Bruce A MSgt USMTM/AFD wrote: >> >>>I am new to python, >>> >>>Could someone explain

Re: when and how do you use Self?

2005-11-03 Thread bruno at modulix
Steven D'Aprano wrote: > On Thu, 03 Nov 2005 10:14:23 +0100, bruno at modulix wrote: > > >>Tieche Bruce A MSgt USMTM/AFD wrote: >> >>>I am new to python, >>> >>> >>> >>>Could someone explain (in English) how and when t

Re: I Need Motivation Part 2

2005-11-04 Thread bruno at modulix
hy would you learn them all ? Learn the one you need when you need them - jus don't forget to have a quick look at the existings modules before reinventing the square wheel (I wrote a Q&D CSV parser before realinzing there was a pretty good one in the stdlib... But what, my Q&D solution to

Re: recursive function call

2005-11-08 Thread bruno at modulix
able ? Testing against the *exact* type of an object is usually not a good idea in Python. You should at least replace this test with something like: if isinstance(arg1, list): #code here or even better: if hasattr(arg1, '__iter__'): # code here or still even better (for mainte

Re: which feature of python do you like most?

2005-11-08 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > which feature of python do you like most? > > I've heard from people that python is very useful. > Many people switch from perl to python because they like it more. > > I am quite familiar with perl, I've don't lots of code in perl. > Now, I was curious and interested i

Re: Diff. between Class types and classic classes

2005-11-08 Thread bruno at modulix
venk wrote: > Hi, > can some one properly explain the differences between class types and > classic classes? ... Still face problems in identifying what is what. I'm not sure I understand your question. Are you talking about the diff between old-style and new-style classes, or the diff between c

Re: Hi, from my login i want to login as a other user ,

2005-11-09 Thread bruno at modulix
sumi wrote: > Hi, from my login i want to login as a other user , how can i do it > using python. http://www.catb.org/~esr/faqs/smart-questions.html -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http:/

Re: append to non-existing list

2005-11-09 Thread bruno at modulix
Yves Glodt wrote: > Hello, > > if I do this: > > for row in sqlsth: > pkcolumns.append(row[0].strip()) > etc > > > without a prior: > > pkcolumns = []; > > > I get this error on first iteration: > UnboundLocalError: local variable 'pkcolums' referenced before assignment > >

Re: append to non-existing list

2005-11-09 Thread bruno at modulix
don't like. It should crash. > [] *is* explicit for > arrays, IIRC, you can also use it to sbscript strings, but I wouldn't bet my life on this. > thus for php it's clear what you want.) Nope. You may be in the case where you think the array already exists, and then you (

Re: iterate over class variables

2005-11-10 Thread bruno at modulix
Yves Glodt wrote: > Yves Glodt wrote: > >> Hello list, >> >> I need to iterate over a class and get all her variable names and >> values, e.g. considering this example: >> >> >> class testclass: >> var1 = 'ab' >> var2 = 'cd' >> var3 = 'ef' Take care, these are *class* variables, not i

Re: getting results into one variable

2005-11-10 Thread bruno at modulix
try ?-) Took me about 30'': >>> def fun(): return 1,2,3 ... >>> a = fun() >>> a (1, 2, 3) >>> def fun2(): return 1,2,3,4,8,9 ... >>> b = fun2() >>> b (1, 2, 3, 4, 8, 9) >>> It of course works since a function *always* retur

Re: What do you use as symbols for Python ?

2005-11-10 Thread bruno at modulix
Pierre Barbier de Reuille wrote: > When you need some symbols in your program, what do you use in Python ? > > For example, an object get a state. This state is more readable if > expressed as a symbols, for example "opened", "closed", "error". > Typically, in C or C++, I would use an enum for tha

Re: derived / base class name conflicts

2005-11-11 Thread bruno at modulix
[EMAIL PROTECTED] wrote: (snip) > So putting two underscores in front of an instance variable (or any > identifier used inside the scope of a class statement) invokes a name > mangling mechanism (snip) > Is it commonplace to use underscores I assume you mean double underscore... > when definin

Re: Command-line tool able to take multiple commands at one time?

2005-11-11 Thread bruno at modulix
Peter A. Schott wrote: > Per subject - I realize I can copy/paste a line at a time into an interactive > session when I'm trying to debug, but was wondering if there is any tool out > there that allows me to copy sections of working Python scripts to paste into > my > interac

Re: Import statements for timeit module

2005-11-11 Thread bruno at modulix
ChaosKCW wrote: > Hi > > I was wondering if someone could help with the import statements needed > to use the timeit module in the following code. I need to access the > "cur" object. > > Thanks, > > import cx_Oracle > import timeit > > def VerifyTagIntegrity(con, TableOwner): > cur = con.c

Re: Nufox : Nouveaux examples...

2005-11-11 Thread bruno at modulix
Salvatore wrote: > Sur : http://www.salvatore.exolia.net:9090/ > (Nécessite Firefox ou Mozilla) > Heu, Salvatore, tu te serais pas un peu trompé de ng, là ?-) (x-post et fu2 f.c.l.py) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL

Re: Calling values from a webform to Python

2005-11-11 Thread bruno at modulix
mjakowlew wrote: > hi, > > I'm trying to pass some values from a webform into a python script. > (snip) > Also this > is done through Zope if that makes a difference to anyone. Yes, it makes a difference. Zope is a world in itself, and is slighty OT here. Note that there's a Zope mailing-list: h

Re: Import statements for timeit module

2005-11-11 Thread bruno at modulix
ChaosKCW wrote: > So timeit is mostly useless then ? > I wouldn't say so. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: replacing multiple instances of commas beginning at specific position

2005-11-14 Thread bruno at modulix
striker wrote: > I have a comma delimited text file that has multiple instances of > multiple commas. Each file will contain approximatley 300 lines. For > example: > > one, two, threefour,fivesix > one, two, three,four,,eighteen, and so on. > > There is one time when multiple

Re: more newbie help needed

2005-11-15 Thread bruno at modulix
Steve Holden wrote: > john boy wrote: > >> using the following program: >> >> fruit = "banana" >> index = 0 >> while index < len (fruit): >> letter = fruit[index-1] >> print letter >> index= index -1 >> >> this program is supposed to spell "banana" backwards and in a vertical >

Re: Need advice on subclassing code

2005-11-15 Thread bruno at modulix
Rusty Shackleford wrote: > Hi -- > > We have some code that returns an object of a different class, depending > on some parameters. For example: > > if param x is 1 and y is 1, we make an object of class C_1_1. > if param x is 1 and y is 2, we make an object of class C_1_2. > > C_1_1 and C_1_2

Re: Default method arguments

2005-11-15 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > Hello everybody! > I have little problem: > > class A: > def __init__(self, n): > self.data = n > def f(self, x = ) > print x > > All I want is to make self.data the default argument for self.f(). (I > want to use 'A' class as following : >

Re: Default method arguments

2005-11-15 Thread bruno at modulix
Dennis Lee Bieber wrote: > > (snip) > but that may not be desirable if None is a valid value => myA.f(None), > so... > > class A(object): > def __init__(self, n): > self.data =n > def f(self, *arg): > if len(arg) == 0: > x = self.data > else: >

Re: HTML generation vs PSP vs Templating Engines

2005-11-16 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > Hello everybody, > > I am in the process of writing my very first web application in Python, > and I need a way to > generate dynamic HTML pages with data from a database. (snip) > After some thought I decided to leave the various frameworks > aside for the > time bein

Re: Python, Linux, Desktop Environment

2005-11-16 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > So, I've written my first GUI app in python. I've turned it into a > binary .exe and .app that runs on Windows and Mac respectively, but on > my Linux box, where I wrote the thing, I still have to drop to the > command line and ./myscript.py. What can I do to make it a

Re: Creating (rather) generic plugin framework?

2005-11-16 Thread bruno at modulix
gt; > def beforePrintHook(self, msg): pass > def afterPrintHook(self, msg): pass > > Now, in the spirit of py.test, I'd like API to be practically no API at all :) > moreover, deploying a plugin must consist simply of adding appropriate file to > plugins directory, nothing

Re: Zope vs Php

2005-11-18 Thread bruno at modulix
Steve wrote: > I am going to go the mod_python route. > > as for why a person would go route one over route 2 > > is that the number of lines of html/output vs python code are usually > 10 to 1 and it's much easier to encapsulate the python code than to > quote and escape all the html/css/xml >

Re: Zope vs Php

2005-11-18 Thread bruno at modulix
Mike Meyer wrote: > Jorge Godoy <[EMAIL PROTECTED]> writes: > >>Mike Meyer <[EMAIL PROTECTED]> writes: >> (snip) > > While I'm at it - how does KID do for things that aren't HTML? It doesn't. Kid is explicitely for XML/HTML templating.

Re: the first element in the list of list

2005-11-22 Thread bruno at modulix
Ben Bush wrote: > I have a lis: > [[1,3],[3,4],[5,6],[8,9],[14,0],[15,8]] > I want a code Then write it. And when (if) you have problems with it, repost, we'll then be happy to help you. > to test when the difference between the first element in > the list of list is equal to or larger than 6,

Re: What a curious assignment.

2005-11-23 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > [test 1] > class A: > > ...i = 1 > ... > a = A() A.i > > 1 > a.i > > 1 > A.i = 2 A.i > > 2 > a.i > > 2 > > > [test2] > class A: > > ...i = 1 > ... > a = A() A.i > > 1 > a.i > > 1 > a.i = 2 A.i

Re: strange behaviour when writing a large amount of data on stdout

2005-11-23 Thread bruno at modulix
Manlio Perillo wrote: > Regards. > > On my system: > Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] > on win32, Windows XP > > I have this problem: > > n = 61409 + 1 data = 'x' * n > > print data > > > Traceback (most recent call last): > File "xxx", lin

Re: user-defined operators: a very modest proposal

2005-11-23 Thread bruno at modulix
Joseph Garvin wrote: > Tom Anderson wrote: > >> Jeff Epler's proposal to use unicode operators would synergise most >> excellently with this, allowing python to finally reach, and even >> surpass, the level of expressiveness found in languages such as perl, >> APL and INTERCAL. s/expressiveness/u

Re: a new design pattern for Python Library?

2005-11-23 Thread bruno at modulix
Ben Sizer wrote: > The Eternal Squire wrote: > >>I tend to use this design pattern a lot in order to aid in >>compartmentalizing interchangeable features in a central class that >>depend on the central class's data. > > > I'm afraid I've read this paragraph and the code 3 times and I still > hav

Re: a new design pattern for Python Library?

2005-11-23 Thread bruno at modulix
Ben Sizer wrote: > bruno at modulix wrote: > >>Ben Sizer wrote: >> >>>I'm afraid I've read this paragraph and the code 3 times and I still >>>have no idea what you're trying to convey. >> >> > > > Got anything more

Re: books: Dive into Python vs Beginning Python

2005-11-25 Thread bruno at modulix
on the first, since it's freely available online. > I'm an experienced C++-programmer who wants to take a look at Python. Then I'd say that Dive into Python may be a good choice. Welcome BTW -- bruno desthuilliers python -c "print '@'.join(['.'.join

Re: Web functions idea

2005-11-29 Thread bruno at modulix
Mark Carter wrote: > I was musing recently about how one could, for example, set up a really > simple mailing subscription list. It occurred to me that a really simple > way to implement it would be to use xmlrpc. > So there could be a function > subscribe(emailAddress), > which would send an email

Re: python speed

2005-11-30 Thread bruno at modulix
David Rasmussen wrote: > Frithiof Andreas Jensen wrote: > >> >> From the speed requirement: Is that correspondance chess by any chance?? >> > > Regular chess at tournament time controls requires speed too. Any pure > Python chess program would lose badly to th

Re: mmm-mode, python-mode and doctest-mode?

2005-12-01 Thread bruno at modulix
John J Lee wrote: > Is it possible to get doctest-mode to work with mmm-mode and python-mode > nicely so that docstrings containing doctests are editable in doctest-mode? I don't know. (snip) > > Any tips appreciated! > Seems like comp.emacs could be a good place for this question -- bru

Re: [OT] mmm-mode, python-mode and doctest-mode?

2005-12-01 Thread bruno at modulix
John J. Lee wrote: > bruno at modulix <[EMAIL PROTECTED]> writes: > > >>John J Lee wrote: >> >>>Is it possible to get doctest-mode to work with mmm-mode and python-mode >>>nicely so that docstrings containing doctests are editable in doctest-mode? &g

Re: Instances behaviour

2005-12-02 Thread bruno at modulix
Inyeol Lee wrote: (snip) class A(object): ... def __init__(self, foo): ... if self.__class__ is A: ... raise TypeError("A is base class.") s/TypeError/NotImplementedError/ s/base class/abstract class/ -- bruno desthuilliers python -c "pri

Re: Instances behaviour

2005-12-02 Thread bruno at modulix
Mr.Rech wrote: > Thanks for your suggestions. They are very usefull and indeed bypass my > problem. However, I've found a (perhaps) more elegant way to get the > same result using metaclasses. (snip code) > > I know metaclasses are a complete different beast, anyway I find this > approach more

Re: Putting in an html table

2005-12-05 Thread bruno at modulix
Little wrote: > Could someone start me on putting in a table into this code, and some > HTML tags. I would to make the table below the map and have a header at > the top. Thanks for the help. > > """ Publisher example """ > > def query(req,

Re: ADD HTML to the code

2005-12-05 Thread bruno at modulix
Little wrote: > Could someone tell me how to add some HTML tags to this program. I want > to be able to change the background color, add some headers, and put a > table below the map that will be displayed. Could someone please tell > me how to add this to the current program. Thanks in advance. >

Re: Efficient lookup in list of dictionaries

2005-12-05 Thread bruno at modulix
David Pratt wrote: (snip) > Can someone advise a more efficient lookup when using lists of > dictionaries. Many thanks. > > > TEST_CONSTANTS = [ > {'color':'red', 'shape':'octagon'}, > {'color':'yellow', 'shape':'triangle'}, > {'color':'green', 'shape':'circle'}] COLOR_INDEX = dict([

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-05 Thread bruno at modulix
ambda: import sys lambda x : sys.stdout.write("%d %d\n" % (x/60, x%60)) > It is constantly pointed out on > this list that the lambda provides no extra expressive power, They do, when one need a very trivial callable for callbacks - which is probably the main (if not the only) use c

Re: dynamic variable referencing

2005-12-07 Thread bruno at modulix
ta'] = 42 > > The purpose is to create an XML tree myself Don't reinvent the wheel. ElementTree (and it's C based brother) are very good at this. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutability of function arguments?

2005-12-08 Thread bruno at modulix
ex_ottoyuhr wrote: > I'm trying to create a function that can take arguments, say, foo and > bar, and modify the original copies of foo and bar as well as its local > versions -- the equivalent of C++ funct(&foo, &bar). This is already what you have. In Python, all you have are references to objec

Virus in your Mail to empire.support

2005-03-18 Thread root at smtp
The VirusCheck at the IMST generated the following Message: V I R U S A L E R T Our VirusCheck found a Virus (W32/Netsky-Q) in your eMail to "empire.support". This eMail has been deleted ! Now it is on you to check your System for Viruses

Virus in your Mail to empire.support

2004-12-03 Thread root at smtp
The VirusCheck at the IMST generated the following Message: V I R U S A L E R T Our VirusCheck found a Virus (W32/Netsky-Q) in your eMail to "empire.support". This eMail has been deleted ! Now it is on you to check your System for Viruses

Re: OO in Python? ^^

2005-12-12 Thread bruno at modulix
Mike Meyer wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >>> ^^ There is no functionality to check if a subclass correctly >>>implements an inherited interface >> >>I don't know of any language that provide such a thing. At least f

Re: Proposal: Inline Import

2005-12-12 Thread bruno at modulix
of modules and OO is that you don't *have* to do things like > that. Cut-n-paste means you wind up with two copies of the code to > maintain, Mike, has it ever occured to you that this could be refactoring, not copy_paste ?-) (for the record, I too frequently *move* - not 'c

Re: Get rid of recursive call __getattr__

2005-12-14 Thread bruno at modulix
Pelmen wrote: > How can I get rid of recursive call __getattr__ inside this method, if > i need to use method or property of the class? > Sorry, but I don't understand your question. Which recursive calls to __getattr__ ? __getattr__ is only called if a/ it's defined and b/ the attribute has not b

Re: Get rid of recursive call __getattr__

2005-12-15 Thread bruno at modulix
Steve Holden wrote: > Peter Otten wrote: > >> Pelmen wrote: >> >> >> class Test: >>> >>> >>> def __getattr__(self, attr): >>>print attr >>> >>> def foo(x): >>>print x >>> >>> >> t = Test() >> print t >>> >>> >>> __str__ >>> >>> Traceback (most

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-15 Thread bruno at modulix
Yechezkal Gutfreund wrote: > Are you familiar with any Python efforts that parrallel Ruby on Rails > (integrated Ajax compliant IDE?). "integrated" and "IDE" in the same sentence ? A bit redundant, isn't it ?-) RoR is not an IDE, it's a web framework. The closest things in Python are TurboGears (

Re: Tuples

2005-12-15 Thread bruno at modulix
Tuvas wrote: > Let's say I make a program something like follows: > > x=[] > x.append([1,2,3]) > x.append([4,5,6]) > print x > print x[0] > print x[0][1] > x[0][1]=5 Where are the tuples ? > Okay, everything works here as expected except the last line. Why won't > this work? Because you forgot

Re: definition of 'polymorphism' and python

2005-12-15 Thread bruno at modulix
Gabriel Zachmann wrote: > I understand the Wikipedia article on Polymorphism > ( http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29 ) > that it doesn't make sense to talk about polymorphism in a fully > dynamically typed language "a single polymorphic operator can act in expressions

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-16 Thread bruno at modulix
Adrian Holovaty wrote: > bruno at modulix wrote: > >>RoR is not an IDE, it's a web framework. The closest things in Python >>are TurboGears (good Ajax/js support via Mochikit), Subway (never >>tested), and Django (no Ajax support AFAIK). > > > Note th

Re: Compressing folders in Windows using Python.

2006-01-01 Thread bren[at]gillatt.org
Heiko Wundram wrote: > Steven D'Aprano wrote: > >>>But when I run this script in Windows XP, I get an error while >>>executing the above zip command. >> >>Would you like to tell us what error you get? > > > I presume the error he's seeing is something along the line of: > > "zip: Bad command or

Re: Template language with XPath support for source code generation?

2006-01-12 Thread bruno at modulix
> I've been looking through Python templating systems all over the place, but I > just can't find one that supports XPath - which is by far the best thing to > have when you generate stuff from XML. TAL might be able to get me part of the > way (at least, it supports some kind

Re: Help me in this please--is Python the answer?

2006-01-12 Thread bruno at modulix
gt; never developed in Python before, so... I'll be evaluating Django > shortly--let me see how it compares to Tomcat. You may also want to have a look at turbogears (roughly similar to Django, but probably much more flexible) My 2 cents -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: how do "real" python programmers work?

2006-01-13 Thread bruno at modulix
Barbier de Reuille Pierre wrote: > On 12 Jan 2006 12:20:50 -0800 > "bblais" <[EMAIL PROTECTED]> wrote: > > >>Hello, >> (snip) > > > Well, I think it will depend on your project ... > If you're developing GUI application, you will have t

  1   2   3   4   5   6   7   >