Re: Regular Expression: Matching substring

2006-04-13 Thread Fredrik Lundh
"Kevin CH" wrote: news:[EMAIL PROTECTED] > Thank you for your reply. > > > Perhaps you are using grep, or you have stumbled on the old deprecated > > "regex" module and are using that instead of the "re" module. Perhaps > > not as you are using only 2 plain vanilla RE operations which should > > w

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Peter Hansen wrote: > > * learning slices is basic to the language (this lesson shouldn't be > > skipped) > > And yet it doesn't appear to be in the tutorial. oh, please. slices are explained in the section on strings, and in the section on lists, and used to define the behaviour of the list met

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Peter Hansen wrote: > It's not even clear that extend needs two lines: > > >>> s = range(5) > >>> more = list('abc') > >>> s[:] = s + more > >>> s > [0, 1, 2, 3, 4, 'a', 'b', 'c'] > > Okay, it's not obvious, but I don't think s[:]=[] is really any more > obvious as a way to clear the list. > >

Re: base64

2006-04-13 Thread Jay
I don't know whether it is right yet but it dues what I wanted it to do now so thank you all, Oh and sorry for my bad grammar. One last thing though is that I would like to be able to split the string up into lines of 89 carictors, I have lookd through the split methods and all I can find is spli

Re: list.clear() missing?!?

2006-04-13 Thread Duncan Booth
Peter Hansen wrote: >> * learning slices is basic to the language (this lesson shouldn't be >> skipped) > > And yet it doesn't appear to be in the tutorial. I could have missed > it, but I've looked in a number of the obvious places, without > actually going through it (again) from start to fin

Re: list.clear() missing?!?

2006-04-13 Thread Duncan Booth
Raymond Hettinger wrote: > Cons: > - > > * learning slices is basic to the language (this lesson shouldn't be > skipped) > also, a clear method would simply clear the entire list. You still need to learn the assigning to/deleting slices technique any time you want to clear out part of a li

Re: list.clear() missing?!?

2006-04-13 Thread Georg Brandl
Duncan Booth wrote: > Peter Hansen wrote: > >>> * learning slices is basic to the language (this lesson shouldn't be >>> skipped) >> >> And yet it doesn't appear to be in the tutorial. I could have missed > Both of these talk about ways to remove slices from a list. Perhaps the > wording coul

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Ben Sizer
Luis M. González wrote: > For those interested in the simplest, easiest and most pythonic web > framework out there, there's a new page in Wikipedia: > > http://en.wikipedia.org/wiki/Karrigell Why is Wikipedia being abused for software promotion and documentation? Articles on Wikipedia are suppos

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread Peter Otten
Peter Hansen wrote: > I think you could just use getopt or optparse, passing in each line > after doing a simple .split() on it.  The resulting handling of the > arguments would be much simpler and cleaner than what you have. > > That won't work perfectly well if you can have quoted arguments wit

Re: Initializing defaults to module variables

2006-04-13 Thread Eric Deveaud
Burton Samograd wrote: > Hi, > > I'm writing an app that stores some user configuration variables in a > file ~/.program/config, which it then imports like so: > > import sys > from posix import environ > sys.path.append(environ["HOME"]+"/.program") > impor

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Ben Sizer" <[EMAIL PROTECTED]> writes: > > http://en.wikipedia.org/wiki/Karrigell > > Why is Wikipedia being abused for software promotion and documentation? > Articles on Wikipedia are supposed to be from a neutral point of view > and purely informative, not biased or instructive. Yes, that art

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread Eric Deveaud
News wrote: > Hi everyone, > > My goal is to pull command switches/options from a file and then assign > the values to select variables which would eventually be included in a > class object. > > The data file looks something like this but the switches could be in any > order and not all ma

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Fredrik Lundh
Ben Sizer wrote: > > http://en.wikipedia.org/wiki/Karrigell > > Why is Wikipedia being abused for software promotion and documentation? > Articles on Wikipedia are supposed to be from a neutral point of view > and purely informative, not biased or instructive. check the page history. it's alread

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread bruno at modulix
News wrote: > Hi everyone, > > My goal is to pull command switches/options from a file and then assign > the values to select variables which would eventually be included in a > class object. > > The data file looks something like this but the switches could be in any > order and not all may be us

Re: how to install PYCURL 7.15.2 on windows 2003?

2006-04-13 Thread Josef Meile
> I download it from http://pycurl.sourceforge.net/ > and then extract it to D:\usr\pycurl-7.15.2 > then > D:\usr\pycurl-7.15.2>setup.py install --curl-dir=d:\usr\pycurl-7.15.2 > Using curl directory: d:\usr\pycurl-7.15.2 > Traceback (most recent call last): > File "D:\usr\pycurl-7.15.2\

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Pierre Quentel
I added an entry in Wikipedia for information, just like other Python web frameworks have already done. If the style doesn't fit Wikipedia's I'm sorry and willing to learn how to improve it ; the reason I read was "Obvious, if elaborate, link spam. Really should be speedied, but I can't find a CSD

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread News
bruno at modulix wrote: > News wrote: >> Hi everyone, >> >> My goal is to pull command switches/options from a file and then assign >> the values to select variables which would eventually be included in a >> class object. >> >> The data file looks something like this but the switches could be in a

Re: Initializing defaults to module variables

2006-04-13 Thread Luke Plant
Burton Samograd wrote: > My question is, how can I setup my program defaults so that they can > be overwritten by the configuration variables in the user file (and so > I don't have to scatter default values all over my code in try/catch > blocks)? The Django web framework happens to do something

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread Eric Deveaud
News wrote: > bruno at modulix wrote: > > > > Have you looked at optparse ? > > > I have. > > The module optparse seemed to be aimed at reading from commandline > versus pulling attributes from a read line. hu lets see optparse seems to be reading from commandline. that's not fa

Re: just one more question about the python challenge

2006-04-13 Thread Roel Schroeven
John Salerno schreef: > Fredrik Lundh wrote: >> John Salerno wrote: >> At the second, don't rename the file, rename the URL. >>> Do you mean rename the URL *aside from* the file name? >> no, the URL you got when you followed georg's instructions will give you >> some data that you need to mani

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Pierre Quentel" <[EMAIL PROTECTED]> writes: > I added an entry in Wikipedia for information, just like other Python > web frameworks have already done. If the style doesn't fit Wikipedia's > I'm sorry and willing to learn how to improve it ; the reason I read > was "Obvious, if elaborate, link spa

List comp bug?

2006-04-13 Thread tasjaevan
I seem to have stumbled across a problem with list comprehensions (or perhaps it's a misunderstanding on my part) [f() for f in [lambda: t for t in ((1, 2), (3, 4))]] is giving me [(3, 4), (3, 4)] The equivalent using a generator expression: [f() for f in (lambda: t for t in ((1, 2),

Re: List comp bug?

2006-04-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I seem to have stumbled across a problem with list comprehensions (or > perhaps it's a misunderstanding on my part) > >[f() for f in [lambda: t for t in ((1, 2), (3, 4))]] List comprehensions are syntactic sugar for "for" loops. The thing to notice is that in "lam

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread bruno at modulix
News wrote: > bruno at modulix wrote: > >>News wrote: >> >>>Hi everyone, >>> >>>My goal is to pull command switches/options from a file and then assign >>>the values to select variables which would eventually be included in a >>>class object. >>> >>>The data file looks something like this but the

Re: ftp connection and commands (directroy size, etc)

2006-04-13 Thread Fulvio
Alle 00:05, giovedì 13 aprile 2006, Arne ha scritto: > a=ftp.sendcmd('Dir') > By trying to get the directory with 'dir' Are you sure that the command 'dir" is understood via ftp? IF I'm not wrong would be 'ls' o list. But since I don't have such psckage on my system, it's recommended you read the

Re: list.clear() missing?!?

2006-04-13 Thread Steven D'Aprano
On Thu, 13 Apr 2006 07:49:11 +, Duncan Booth wrote: > Raymond Hettinger wrote: > >> Cons: >> - >> >> * learning slices is basic to the language (this lesson shouldn't be >> skipped) >> > also, a clear method would simply clear the entire list. You still need to > learn the assigning to

how to match n- lists for a common elements.

2006-04-13 Thread Grzegorz Ślusarek
Hi all. I my application i have situation when i have some lists and i must get from lists common elements. Exacly i don't know how many list I have so at the moment of creation each of one I append them to one list. So I get list wchich consist of lists of objects. And now i want to get comm

Re: Figure out month number from month abbrievation

2006-04-13 Thread Fulvio
Alle 04:41, giovedì 13 aprile 2006, Fredrik Lundh ha scritto: > but it also looks as if the meaning of the word "localized" isn't clear to > you; if you changed the locale, those names will be translated Mine behave strangely. Linux localized for Italian, but Python (or its calander is in english

Re: list.clear() missing?!?

2006-04-13 Thread Steven D'Aprano
On Thu, 13 Apr 2006 09:11:31 +0200, Fredrik Lundh wrote: > Peter Hansen wrote: > >> It's not even clear that extend needs two lines: >> >> >>> s = range(5) >> >>> more = list('abc') >> >>> s[:] = s + more >> >>> s >> [0, 1, 2, 3, 4, 'a', 'b', 'c'] >> >> Okay, it's not obvious, but I don't thi

Re: List comp bug?

2006-04-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >I seem to have stumbled across a problem with list comprehensions (or > perhaps it's a misunderstanding on my part) > > [f() for f in [lambda: t for t in ((1, 2), (3, 4))]] > > is giving me > > [(3, 4), (3, 4)] > > The equivalent using a generator expression: > >[

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Pierre Quentel
Ok, thanks for the information. I have rewritten the page in a more neutral way and removed the tutorial-like part, I'll put in in wikibooks -- http://mail.python.org/mailman/listinfo/python-list

Re: how to match n- lists for a common elements.

2006-04-13 Thread bruno at modulix
Grzegorz Ślusarek wrote: > Hi all. I my application i have situation when i have some lists and i > must get from lists common elements. Exacly i don't know how many list I > have so at the moment of creation each of one I append them to one > list. So I get list wchich consist of lists of objects

Re: list.clear() missing?!?

2006-04-13 Thread Peter Hansen
Alan Morgan wrote: > Ah, but if you know your basic python then you wouldn't be looking for > s.clear() in the first place; you'd just use s[:]=[] (or s=[], whichever > is appropriate). One of very first things newcomers learn (I believe, though I don't know how soon the tutorial teaches it) is

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread News
bruno at modulix wrote: > News wrote: >> bruno at modulix wrote: >> >>> News wrote: >>> Hi everyone, My goal is to pull command switches/options from a file and then assign the values to select variables which would eventually be included in a class object. The da

Re: list.clear() missing?!?

2006-04-13 Thread Peter Hansen
Duncan Booth wrote: > Peter Hansen wrote: > Looking in the 'obvious' place in the Tutorial, section 5.1 'More on > Lists' I found in the immediately following section 5.2 'The del > statement': > >>There is a way to remove an item from a list given its index instead >>of its value: the del state

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Peter Hansen wrote: > One of very first things newcomers learn (I believe, though I don't know > how soon the tutorial teaches it) let's see. lists are introduced on page 19, a more extensive discussion of lists is found on page 33, the del statement appears on page 34, and the dir() function i

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Pierre Quentel" <[EMAIL PROTECTED]> writes: > Ok, thanks for the information. I have rewritten the page in a more > neutral way and removed the tutorial-like part, I'll put in in wikibooks It's much better now, and I think it won't be deleted. -- http://mail.python.org/mailman/listinfo/python-li

Cannot import htmllib

2006-04-13 Thread geir . smestad
Using Ubuntu Breezy Badger 5.10. I get the following traceback: - Traceback (most recent call last): File "/home/geir/programmering/htmlparse/formatter.py", line 1, in -toplevel- import formatter File "/home/geir/programmering/htmlparse/formatter.py", line 2, in -toplevel- import h

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Pierre Quentel" <[EMAIL PROTECTED]> writes: > Ok, thanks for the information. I have rewritten the page in a more > neutral way and removed the tutorial-like part, I'll put in in wikibooks I don't know if you really want to put the tutorial in wikibooks, since there's already documentation on kar

Re: Figure out month number from month abbrievation

2006-04-13 Thread Fredrik Lundh
"Fulvio" wrote: > > but it also looks as if the meaning of the word "localized" isn't clear to > > you; if you changed the locale, those names will be translated > > Mine behave strangely. Linux localized for Italian, but Python (or its > calander is in english) Python defaults to the C locale, w

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-13 Thread Wildemar Wildenburger
Petr Prikryl wrote: > My question: Could the old classes be treated in > a new Python treated as new classes with "implicit" > base object? (I know the Zen... ;-) > > Example: I use usually a very simple classes. When I add > "(object)" to my class definitions, the code continues to > works fine --

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread Gerard Flanagan
News wrote: > OT: I saw several references to "OP". What does this mean? It's a TOOTKA :-) You - The Original Post/Poster. Gerard -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot import htmllib

2006-04-13 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > As far as I can see, the files formatter.py and htmllib.py are where > they are supposed to be, in /usr/lib/python2.4/. You probably have aliased it by calling your main program formatter.py, or something similar. -- http://mail.

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-13 Thread Robert Kern
Petr Prikryl wrote: > "Aahz" wrote... > >>Bruno Desthuilliers wrote: >> >>>Aahz a �crit : > > [...] > >Please repeat this 101 times each morning: >"thou shall not use old-style classes for they are deprecated". Classic classes are *NOT* deprecated. >>> >>>Perhaps not *officially

Re: Cannot import htmllib

2006-04-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > - > Traceback (most recent call last): > File "/home/geir/programmering/htmlparse/formatter.py", line 1, in > -toplevel- >import formatter > File "/home/geir/programmering/htmlparse/formatter.py", line 2, in > -toplevel- >import htmllib > File "/usr/lib/py

Re: Cannot import htmllib

2006-04-13 Thread geir . smestad
Thanks a lot! You are quite right. (By the way, this is the first time ever I post something to a newsgroup. Thanks for giving me a good first impression :D) -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-13 Thread Mel Wilson
Alan Morgan wrote: > In article <[EMAIL PROTECTED]>, > Raymond Hettinger <[EMAIL PROTECTED]> wrote: >>* s.clear() is more obvious in intent > > Serious question: Should it work more like "s=[]" or more like > "s[:]=[]". I'm assuming the latter, but the fact that there is > a difference is an argu

Re: Figure out month number from month abbrievation

2006-04-13 Thread Fulvio
Alle 20:16, giovedì 13 aprile 2006, Fredrik Lundh ha scritto: > >>> locale.setlocale(locale.LC_ALL, "it_IT") > > 'it_IT' Thank you Great & kind explanation F -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-13 Thread Mel Wilson
Steven D'Aprano wrote: > Convenience and obviousness are important for APIs -- that's why lists > have pop, extend and remove methods. The only difference I can see between > a hypothetical clear and these is that clear can be replaced with a > one-liner, while the others need at least two, e.g. fo

Re: Python2CPP ?

2006-04-13 Thread jpierce
Diez B. Roggisch wrote: > > 1) Curiosity. I would like to see how well the translation goes. > > If there is something that works, it will look awful to the eye. > Code-generators are generally not very idiomatic - they mapping is to > localized to e.g. factorize out a more complex loop to somethi

Re: Python2CPP ?

2006-04-13 Thread jpierce
Diez B. Roggisch wrote: > > 1) Curiosity. I would like to see how well the translation goes. > > If there is something that works, it will look awful to the eye. > Code-generators are generally not very idiomatic - they mapping is to > localized to e.g. factorize out a more complex loop to somethi

Re: list.clear() missing?!?

2006-04-13 Thread Peter Hansen
Fredrik Lundh wrote: > Peter Hansen wrote: >>One of very first things newcomers learn (I believe, though I don't know >>how soon the tutorial teaches it) > > let's see. lists are introduced on page 19, a more extensive discussion of > lists is > found on page 33, the del statement appears on pag

py2exe wx.lib.activexwrapper win32com

2006-04-13 Thread [EMAIL PROTECTED]
I try to create an exe using py2exe, but i've got some troubles. In my application, i use a flash activex control with wxPython (wx.lib.activexwrapper). I get the following lines in the log when i run my executable Code: Traceback (most recent call last): File "main.py", line 8, in ? File "mis

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread News
Hi everyone, Just to be complete, my final solution was: parser = OptionParser() parser.add_option("-m","--qmanager", dest="qmanager", help="\t\tQueue Manager to inquire against"), parser.add_option("-s","--server", dest="host", help="\t\tHost

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Pierre Quentel" <[EMAIL PROTECTED]> wrote: > I added an entry in Wikipedia for information, just like other Python > web frameworks have already done. If the style doesn't fit Wikipedia's > I'm sorry and willing to learn how to improve it ; the reason I read > was

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Roel Schroeven
Luis M. González schreef: > For those interested in the simplest, easiest and most pythonic web > framework out there, there's a new page in Wikipedia: > > http://en.wikipedia.org/wiki/Karrigell There's something I don't quite get regarding the Karrigell- and CherryPy-style frameworks. With PHP

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
Roy Smith <[EMAIL PROTECTED]> writes: > Please don't misunderstand my actions. I'm all for promoting > Python, and your Karrigel system looks interesting. Wikipedia is > just not the correct forum for such promotion. There is a fine line > between promotion and documentation. It's often difficu

Re: Iterating command switches from a data file - have a working solution but it seems inefficient

2006-04-13 Thread bruno at modulix
News wrote: (snip) > sometimes you can't see the forest .. trees and all that :) Yes, been here too... I wrote a CSV parser before realising there was a pretty good one in the standard lib :( (snip) > OT: I saw several references to "OP". What does this mean? Original Poster -- bruno desthuill

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Roel Schroeven < [EMAIL PROTECTED]> wrote: There's something I don't quite get regarding the Karrigell- andCherryPy-style frameworks. With PHP or mod_python I can put any numberof different applications in different directories on a web server, which is very convenient: [SNIP]How do

Re: just one more question about the python challenge

2006-04-13 Thread Jerry
This one threw me for a loop as well. I looked at that gfx file for a whole day before I finally understood what was in it. I only knew to separate it into five piles because of the hint forums though. I guess I'm not intuitive enough. :) I too did this challenge without PIL. Just remember th

Re: quiet conversion functions

2006-04-13 Thread Sion Arrowsmith
Tim Chase <[EMAIL PROTECTED]> wrote: >def CFloat(value): > try: > value = float(value) > except (ValueError, TypeError): > value = 0 > return value >>> type(CFloat(None)) I think you want value = 0.0 . And you might also want to consider what errors

new-style classes and len method

2006-04-13 Thread Thomas Girod
Hi there. I'm trying to use new-style classes, but there is something i'm obviously missing here it is : class Data(list): __slots__ = ["width", "height", "label"] def __init__(self,width,height,label=None): list.__init__(self) self.width = width self.height = he

trying to grasp OO : newbie Q?

2006-04-13 Thread mitsura
Hi, I just started with Python and I am new to OO programming. Here is a simple code: " class Obj: myVar = 1 def __init__(self): myVar = 2 # myObj = Obj() print myObj.myVar " The output is of this script is '1'. I would except it to be '2'. I not understanding

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Peter Hansen wrote: > You're spending a lot of time trying to convince me I'm wrong no, I'm just posting observable facts in response to various "I'm too lazy to look this up, but I'll assume that things are this way" posts. > Thankfully (to Georg) it's fixed in the wiki too... talking about t

Re: list.clear() missing?!?

2006-04-13 Thread Mystilleef
I agree. Lists should have a clear method. But what's shocking is that it doesn't seem obvious to others. list.clear() is a whole lot more readable, intuitive, "flowable" and desirable than del list. Or maybe I haven't had enough coffee this morning. I'd go as far as saying all container objects sh

Re: new-style classes and len method

2006-04-13 Thread Thomas Girod
Or maybe I'm mixing up what we call a "classmethod" with what we could call an "instance method" ? -- http://mail.python.org/mailman/listinfo/python-list

Re: new-style classes and len method

2006-04-13 Thread Paul McGuire
"Thomas Girod" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there. > > I'm trying to use new-style classes, but there is something i'm > obviously missing > > here it is : > > class Data(list): > __slots__ = ["width", "height", "label"] > > def __init__(self,width,height

Re: list.clear() missing?!?

2006-04-13 Thread Richie Hindle
[Mystilleef] > Lists should have a clear method. But what's shocking is that > it doesn't seem obvious to others. list.clear() is a whole lot more > readable, intuitive, "flowable" and desirable than [the alternatives] +1 to all of that. -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python

DC panel and subpanel

2006-04-13 Thread python
I’m trying to test a system of created one main panel that will house the wx.DC that will pass that DC to all the attached items and then they will draw on that DC. With this system you should be able to attach a sub-panel to it along with any items to that sub-panel as well so that you can have ob

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Azolex
[EMAIL PROTECTED] wrote: > Hi, > > I just started with Python and I am new to OO programming. > Here is a simple code: > " > class Obj: > myVar = 1 > > def __init__(self): > myVar = 2 > > # > > > myObj = Obj() > > print myObj.myVar > " > > The output is of this scri

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread Thomas Bartkus
"Carl Banks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Bartkus wrote: > > Does anyone use emacs together with both WordStar key bindings and python > > mode? I'm afraid that Wordstar editing key commands are burned R/O into my > > knuckles! > > Old Borland C user? Worse

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread J Rice
Someone should correct me if I'm wrong but: If you add "print myVar" to __init__, you will see that myVar is assigned to "2" in that function. It doesn't change the assignment of "1" in the class because myVar in __init__ is local to __init__. If you want to change myVar for the whole class, yo

Re: new-style classes and len method

2006-04-13 Thread Ben C
On 2006-04-13, Thomas Girod <[EMAIL PROTECTED]> wrote: > Hi there. > > I'm trying to use new-style classes, but there is something i'm > obviously missing > > here it is : > > class Data(list): > __slots__ = ["width", "height", "label"] > > def __init__(self,width,height,label=None): >

How do i use ~/.alias within 'ipython -p pysh'?

2006-04-13 Thread noman
Pasting the contents of ~/.alias into ~/.ipython/ipythonrc-pysh causes all of my normal system aliases to be sourced and used by ipython, but only the single token aliases work. For example, this alias: alias l 'ls' works, but this one: alias ll 'ls -AhlF' doesn't work. It replies:

Re: example of logging w/ user-defined keywords?

2006-04-13 Thread Vinay Sajip
Chris Curvey wrote: > Several things that I've read lead me to think this is possible, but I > can't figure out how to do it. I have some information (a "job > number") that I would like logged on every log message, just like the > time or the severity. > > I saw some mail threads that suggested

Parse email delivery status notifications (DSN) ?

2006-04-13 Thread Christopher Arndt
(please CC me in you replies if possible, I am not on the list) Hi, I am trying to write a script, that processes bounced emails from our mailing campaigns to remove them from the distribution list and to update the customer database. Since our mailing program is not able to set the "Return-Path

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Ben C
On 2006-04-13, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I just started with Python and I am new to OO programming. > Here is a simple code: > " > class Obj: > myVar = 1 > > def __init__(self): > myVar = 2 > > # > > > myObj = Obj() > > print myObj.myVar > " >

Re: py2exe wx.lib.activexwrapper win32com

2006-04-13 Thread [EMAIL PROTECTED]
it doesn't work only under windows 98 first edition, still don't know how to fix this. -- http://mail.python.org/mailman/listinfo/python-list

Re: just one more question about the python challenge

2006-04-13 Thread JW
You said: > Sorry to post here about this again, but the hint forums are dead, and > the hints that are already there are absolutely no help (mostly it's > just people saying they are stuck, then responding to themselves saying > the figured it out! not to mention that most of the hints require > g

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Wildemar Wildenburger
J Rice wrote: > Someone should correct me if I'm wrong but: > If > you want to change myVar for the whole class, you need to reference it > as self.myVar. > wrong: If you want to change myVar for the whole *class*, you need to reference it as Obj.myVar (prefix with classname). self.myVar will c

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Roel Schroeven
Tim Williams (gmail) schreef: > > > On 13/04/06, *Roel Schroeven* < [EMAIL PROTECTED] > > wrote: > > > > There's something I don't quite get regarding the Karrigell- and > CherryPy-style frameworks. With PHP or mod_python I can put any number > of differe

Re: list.clear() missing?!?

2006-04-13 Thread gry
A perspective that I haven't seen raised here is inheritance. I often say mylist = [] if I'm done with the current contents and just want a fresh list. But the cases where I have really needed list.clear [and laboriously looked for it and ended up with del l[:] were when the object was my o

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread mitsura
Thanks guys, It is starting to make much more sense. Most documentation I find about OO is very academic -- http://mail.python.org/mailman/listinfo/python-list

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Luis M. González
When you talk about the "Karrigell folks" it looks like there's a bunch of guys out there ploting to rule the world. It's nothing like that. I just read Pierre's comments about this article, and decided to post a message in comp.lang.python to let everybody know about it. Perhaps my post looked li

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Pierre Quentel
The web server in Karrigell is actually application-independant. An application is a set of scripts or static files, generally stored in the same directory ; the server parses the http requests, searches for a file matching this request, processes the file according to its extension and sends the r

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Roel Schroeven <[EMAIL PROTECTED]> wrote: Tim Williams (gmail) schreef:> Karrigell will happily run multiple karrigell "applications" on a single> server .  In your example simply by having different applications at > http://foo.example.com/app1 and http://foo.example.com/app2 will d

quick surface plots

2006-04-13 Thread buchstaebchen
Hi folks, I need advice in finding an appropriate python module for 3D surface plots, such as for the visualization of wave-dynamics...I'd prefer something capable of being embedded in wxpython frames, as matplotlib is doing pretty well for 2D, however, I couldn't get a hold of functions like the

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Pierre Quentel
No, in the document root you create a folder "app1" and put all the files for the first application in it, and a folder "app2" for the second application For http://foo.example.com/app1 the server will search for an index file in this directory and serve it. You can also specify the script you wan

Looking for thoughts on PyMPI

2006-04-13 Thread Carl J. Van Arsdall
Hey, anyone use the PyMPI suite: http://sourceforge.net/projects/pympi/ ?? I am an engineer doing research with MPI and thought I'd do some digging to see if any scripting languages had adopted it yet. I was just looking for general comments and reviews from the community on this project, tha

Re: list.clear() missing?!?

2006-04-13 Thread Steven Bethard
Raymond Hettinger wrote: > [Steven Bethard] >> I think these are all good reasons for adding a clear method, but being >> that it has been so hotly contended in the past, I don't think it will >> get added without a PEP. Anyone out there willing to take out the best >> examples from this thread an

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > It is starting to make much more sense. Most documentation I find about > OO is very academic you may find Jay Parlar's new python class tutorial helpful: http://parlar.infogami.com/pytut_classes_copy (this is a proposed addition/replacement for the class chapter

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: In Karrigell you could write the host mappings into a karrigell script (.ks) application, so you wouldn't  even need to use virtual-hosts in the config file.  and of course, you could just write a single ..ks  that contains (at least the

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Pierre Quentel" <[EMAIL PROTECTED]> writes: > For http://foo.example.com/app1 the server will search for an index > file in this directory and serve it. You can also specify the script > you want : http://foo.example.com/app1/default.py. Same thing for app2 > of course. Absolutely no need to start

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Luis M. González" <[EMAIL PROTECTED]> writes: > I appreciate all the observations regarding Wikipedia's nature, but I > confess that I'm surprised to see you, "python folks", so annoyed by > this article. I think it's more "wikipedia folks" (I'm one) who found the original version of the article

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread John Salerno
[EMAIL PROTECTED] wrote: > Thanks guys, > > It is starting to make much more sense. Most documentation I find about > OO is very academic Couldn't we also say that this issue of namespace scope is a little more specific to Python than OOP in general? I could very easily be wrong, but I wouldn't

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Mel Wilson wrote: > > for item in seq: > > L.append(item) > > Both extend and append have one-line slice equivalents, > except that the equivalents have to keep referring to > the length of the list.. (have to keep finding the > len function.) fwiw, the *tutorial* defines append and extend in

Re: new-style classes and len method

2006-04-13 Thread Thomas Girod
It's alright I found where my mistake came from. I was misunderstanding the meaning of "classmethod", thinking of it as an instance method. -- http://mail.python.org/mailman/listinfo/python-list

Re: just one more question about the python challenge

2006-04-13 Thread John Salerno
JW wrote: > There are SEVEN pages of clues for level 12. The most recent post (to > challenge 1) was on April 11, so the forums are most certainly not > dead. I read those seven pages at least twice and they still don't make much sense to me (not to mention that many of the posts are just co

PEP 359: The "make" Statement

2006-04-13 Thread Steven Bethard
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions! PEP: 359 Title: The "make" Statement Version: $Revision: 45366 $ Last-Modified: $Date: 2006-04-13 0

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Roel Schroeven
Pierre Quentel schreef: > No, in the document root you create a folder "app1" and put all the > files for the first application in it, and a folder "app2" for the > second application > > For http://foo.example.com/app1 the server will search for an index > file in this directory and serve it. You

  1   2   >