Re: Using python for a CAD program

2006-05-22 Thread David Cuthbert
baalbek wrote: > No, concurrent access is highly relevant; for example, on a team of > about 50 architects working on design and production drawings for a new > hospital, each floor was one 'drawing' (dwg file), and thus stored on > disk as a separate entity from the other floors. > > Now, only

multithreading - managing transactions and sequence of processing

2006-05-22 Thread Jaco Smuts
Hello there question: I'm looking for information / patterns / recipe's for implementing a multi threaded program (multiple producers / consumers) that will manage transactions and maintain sequence across the different threads. background: I'm busy writing an adapter taking messages from ibm

Index counting from the last char

2006-05-22 Thread gisleyt
I'd like to use the index-function to retrieve a certain char in a string, but i need it to start counting from the last char. E.g. in the string. Foo-bar, foo foo-bar I want the latter hyphen to be returned when i do a index for '-'. Is there any built in function for this, I don't want to reve

Re: Index counting from the last char

2006-05-22 Thread Duncan Booth
gisleyt wrote: > I'd like to use the index-function to retrieve a certain char in a > string, but i need it to start counting from the last char. > > E.g. in the string. > > Foo-bar, foo foo-bar > > I want the latter hyphen to be returned when i do a index for '-'. Is > there any built in funct

Re: Complex evaluation bug

2006-05-22 Thread of
Heiko Wundram wrote: > Am Freitag 19 Mai 2006 18:03 schrieb Paul McGuire: > >>An eval-less approach - the problem is the enclosing parens. >> > > > I've just submitted two patches to the Python bugtracker at: > > http://sourceforge.net/tracker/index.php?func=detail&aid=1491866&group_id=5470&ati

Re: Tk.iconname still there?

2006-05-22 Thread Eric Brunel
On 22 May 2006 10:56:16 +1000, Gary Wessle <[EMAIL PROTECTED]> wrote: > Hi > > I am going through a tutorial on Tkinter > http://doctormickey.com/python/pythontutorial_201.html, it referees to > Tk.iconname() but I could not locate one after googleing and browsed > and searched the Tkinter On-line

Re: Software Needs Philosophers

2006-05-22 Thread Mumia W.
Xah Lee wrote: > Software Needs Philosophers > > by Steve Yegge, 2006-04-15. > > Software needs philosophers. > > [...] > > This post is archived at: > http://steve-yegge.blogspot.com/2006/04/software-needs-philosophers.html > > and > http://xahlee.org/Periodic_dosage_dir/_p/software_phil.

Doubt with wx.CallAfter

2006-05-22 Thread carlosperezs
Hello together:: I have programmed this fuction: def OnNewMovie(self, event): """ Local user receives a new movie event from a user""" #self.log.debug( "Got OnNewMovie, " + `event`) if event.data[0] == self.pubId: fDep.write("New movie equal\n")

Re: dict!ident as equivalent of dict["ident"]

2006-05-22 Thread Alexander Kozlovsky
Edward Elliott wrote: >> With this suggestion, mapping!identifier >> becomes fully equivalent to mapping["identifier"] > > Penny-wise, pound-foolish. Saves 3 character strokes at the cost of a new > special-purpose operator which only works in limited circumstances. To > avoid pars

Re: Software Needs Philosophers

2006-05-22 Thread Mirco Wahab
after all, somebody dumped some backup of his brain to use-net: > Software Needs Philosophers > by Steve Yegge, 2006-04-15. including lots of personal details. So what I basically took from it is written in this paragraph: > I was born and raised a Roman Catholic, and I renounced it when I was

Re: getattr for modules not classes

2006-05-22 Thread Daniel Nogradi
> > Is there something analogous to __getattr__ for modules? > > > > I know how to create a class that has attributes from a list and > > nothing else by overloading __getattr__ and making sure that the > > accessed attribute appears in my list. Now I would like to do the same > > with a module, sa

Dumb-as-rocks WSGI serving using standard library

2006-05-22 Thread Ben Finney
Howdy all, I'm trying to implement some new functionality for an existing PHP web application. Rather than writing a whole lot of stuff in PHP, and looking toward a future when more of the application can be rewritten more sanely, I'd like to write a Python program that generates the content and s

Re: altering an object as you iterate over it?

2006-05-22 Thread bruno at modulix
Paul McGuire wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] > >>bruno at modulix a écrit : >>(snip) >> >>(responding to myself) >>(but under another identity - now that's a bit schizophrenic, isn't it ?-) >> > > > Do you ever flame yourself? class M

Re: Name conflict in class hierarchy

2006-05-22 Thread bruno at modulix
Ralf Muschall wrote: > Jeffrey Barish wrote: > > [overriding of base class member functions by subclass] > (snip) > > In Python, a function not intended to be overriden should be either > have a name starting with an underscore actually with *two* underscores. The single-leading-underscore nami

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread bruno at modulix
Edward Elliott wrote: > George Sakkis wrote: > > >>Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu: >> >>>for node in tree if node.haschildren(): >>> >>> >>>as syntactic sugar for: >>> >>>for node in tree: >>>if not node.haschildren(): >>>continue >>> > > [snip] > >>2) "There should b

Re: Generating Cutter numbers

2006-05-22 Thread Gerard Flanagan
Terry Reedy wrote: > "Gerard Flanagan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I'm cataloging a small library and want to generate a unique id (called > > a 'call number') for each book. This id is composed of: > > > > * Dewey 3-digit Subject Classification Number > > * D

Re: Dumb-as-rocks WSGI serving using standard library

2006-05-22 Thread Stephan Diehl
On Mon, 22 May 2006 18:18:34 +1000, Ben Finney wrote: [...] > > Everything else that I can find leads to dependencies I don't want for > flexibility I don't need: cherrypy, paste, et al. > > Any suggestions for how to serve up a simple WSGI application with > just the standard library? the easi

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Boris Borcic
Heiko Wundram wrote: ... > As I've noticed that I find myself typing the latter quite often > in code I write, it would only be sensible to add the corresponding > syntax for the for statement: > > for node in tree if node.haschildren(): > > > as syntactic sugar f

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Heiko Wundram
Am Montag 22 Mai 2006 11:27 schrieb Boris Borcic: > Mhhh, your unsugared form remind me of darks hours with primitive BASICS in > my youth - the kind Dijsktra commented on. Why don't you write > > for node in tree: > if node.haschildren(): > As I've replied on

Menu's problem

2006-05-22 Thread carlosperezs
Hello together : I have programmed that: a listCtrl with binding functions. self.ListCtrlMarks = wx.ListCtrl(self.panel, -1, style = wx.LC_REPORT) self.Bind(wx.EVT_LIST_ITEM_SELECTED,self.OnSelectedItem,self.ListCtrlMarks) self.ListCtrlMarks.Bind(wx.EVT_RIGHT_DOWN, self.OnRightD

Includeing Python in text files

2006-05-22 Thread Paolo Pantaleo
I am working on this: I have a text file, containig certain section in the form I parse the text file and substitute the python code with its result [redirecting sys.stdin to a StringIO]. It something like php or embedded perl. So my little toy works not bad, but I was wondering if such a feat

Re: Includeing Python in text files

2006-05-22 Thread Diez B. Roggisch
Paolo Pantaleo wrote: > I am working on this: > > I have a text file, containig certain section in the form >python code here > py?> > > I parse the text file and substitute the python code with its result > [redirecting sys.stdin to a StringIO]. It something like php or > embedded perl. >

Re: performance difference between OSx and Windows

2006-05-22 Thread Brian
As one additional question, can someone point me in the direction of a resource that would explain how I could use Python to tell me what core is actually handling the process? I am not even sure if something like this exists, but it would be an interesting feature to explore. Thanks, Brian --

Re: Includeing Python in text files

2006-05-22 Thread looping
Paolo Pantaleo wrote: > I am working on this: > > I have a text file, containig certain section in the form >python code here > py?> > > I parse the text file and substitute the python code with its result > [redirecting sys.stdin to a StringIO]. It something like php or > embedded perl. > >

string.count issue (i'm stupid?)

2006-05-22 Thread Matteo Rattotti
Hi all, i've noticed a strange beaviour of string.count: in my mind this code must work in this way: str = "a_a_a_a_" howmuch = str.count("_a_") print howmuch -> 3 but the count return only 2 Ok this can be fine, but why? The doc string tell that count will return the number of substring in th

Re: Includeing Python in text files

2006-05-22 Thread Laurent Pointal
Paolo Pantaleo a écrit : > I am working on this: > > I have a text file, containig certain section in the form > python code here > py?> > > I parse the text file and substitute the python code with its result > [redirecting sys.stdin to a StringIO]. It something like php or > embedded perl. >

Re: string.count issue (i'm stupid?)

2006-05-22 Thread Dirk Hagemann
I think I can tell you WHY this happens, but I don't know a work-around at the moment. It seems as if only the following "_a_" (A) are counted: a_A_a_A_ regards Dirk -- http://mail.python.org/mailman/listinfo/python-list

Re: string.count issue (i'm stupid?)

2006-05-22 Thread Diez B. Roggisch
Matteo Rattotti wrote: > Hi all, > > i've noticed a strange beaviour of string.count: > > in my mind this code must work in this way: > > str = "a_a_a_a_" > howmuch = str.count("_a_") > print howmuch -> 3 > > but the count return only 2 > > Ok this can be fine, but why? The doc string tell th

Re: string.count issue (i'm stupid?)

2006-05-22 Thread Alexandre Fayolle
Le 22-05-2006, Matteo <[EMAIL PROTECTED]> nous disait: > Hi all, > > i've noticed a strange beaviour of string.count: > > in my mind this code must work in this way: > > str = "a_a_a_a_" > howmuch = str.count("_a_") > print howmuch -> 3 > > but the count return only 2 > > Ok this can be fine, but w

Re: string.count issue (i'm stupid?)

2006-05-22 Thread Alexander Schmolck
"Dirk Hagemann" <[EMAIL PROTECTED]> writes: > I think I can tell you WHY this happens, but I don't know a work-around > at the moment. len(re.findall('_(?=a_)', '_a_a_a_a_')) # untested def countWithOverlaps(s, pat): return len(re.findall("%s(?=%s)" % (re.escape(pat[0]), re.escape(pat[1:]))

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-22 Thread Claudio Grondi
sturlamolden wrote: > Julien Fiore wrote: > >>Thanks for your remark, Sturlamolden. >> >>Is there a free version of the "Visual C++ 2003" compiler available on >>the web? I have found "Visual C++ 2005 Express edition" >>(http://msdn.microsoft.com/vstudio/express/visualc/). According to >>Micrsoft,

grabbing portions of a file to output files

2006-05-22 Thread s99999999s2003
hi. I have a file with this kind of structure: Hxxx . . . x Hxxx ... ... x H . and so onlines starting with 'H' are headers. I wish to get the parts of the file where l

Re: about py2exe, I installed it, but can't find py2exe.exe in my computer.

2006-05-22 Thread python
it prompt: invalid command 'py2exe'. I have import py2exe in setup.py file. -- http://mail.python.org/mailman/listinfo/python-list

Re: string.count issue (i'm stupid?)

2006-05-22 Thread bruno at modulix
Matteo Rattotti wrote: > Hi all, > > i've noticed a strange beaviour of string.count: > > in my mind this code must work in this way: > > str = "a_a_a_a_" dont use 'str' as an identifier, it shadows the builtin str type. > howmuch = str.count("_a_") > print howmuch -> 3 > > but the count retu

Running script in __main__ shows no output in IDLE

2006-05-22 Thread [EMAIL PROTECTED]
I just downloaded the most recent (2.4.3) Python and IDLE (1.1.3) to Windows XP Professional. I'm new to the IDLE environment, so hopefully someone can tell me what I'm missing here! Below is the code, which I'm editing within IDLE, and attempting to test with the Run commands. I was expecting to

Re: Using python for a CAD program

2006-05-22 Thread baalbek
David Cuthbert wrote: > This does not mean the design itself should be stored as an RDBMS. As > I've stated previously, CAD data (both electrical and, it appears, > mechanical) does not lend itself to RDBMS relationship modeling. I simply do not agree with this. A CAD program (like Autocad) i

Re: grabbing portions of a file to output files

2006-05-22 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > hi. > I have a file with this kind of structure: > > Hxxx > . > . > . > x > Hxxx > ... > > ... > x > H > . > > and so onlines starting with '

RE: Iterating generator from C (PostgreSQL's pl/python RETUN SETOF/RECORD iterator support broken on RedHat buggy libs)

2006-05-22 Thread Hannu Krosing
I try to move this to -dev as I hope there more people reading it who are competent in internal working :). So please replay to -dev only. - The question is about use of generators in embedde v2.4 with asserts enabled. Can somebody explain, why the code in try2.c works with wrappers

Delivery failure notification

2006-05-22 Thread Symantec_Mail_Security_for_SMTP
Your message with Subject: yrzlpth could not be delivered to the following recipients: [EMAIL PROTECTED] Please do not resend your original message. Delivery attempts will continue to be made for 5 day(s). -- http://mail.python.org/mailman/listinfo/python-list

Re: Dumb-as-rocks WSGI serving using standard library

2006-05-22 Thread Damjan
> What I can't find is a simple recipe to serve a WSGI application with > a dumb-as-rocks HTTP server, just using the standard Python library. > > The standard library includes BaseHTTPServer, which as far as I can > tell doesn't know anything about WSGI. > > Everything else that I can find leads

Re: newbie: windows xp scripting

2006-05-22 Thread Larry Bates
oscartheduck wrote: > For completeness' sake, this is the new script I came up with: > > import os > > dirfrom = 'C:\\test' > dirto = 'C:\\test1\\' > makedir = 'mkdir "%s"' % dirto > copy_command = 'copy "%s" "%s"' % (dirfrom, dirto) > > if os.system(copy_command) == 0: > print "yay" > else:

problem with writing a simple module

2006-05-22 Thread nephish
ello there. i am having a problem getting a module to work right. i wrote a class that is going to be used in a few different scripts in the same directory. it looks like this: #!/usr/bin/python import MySQLdb class DbConnector(object): """ Database Connection object. c

Re: problem with writing a simple module

2006-05-22 Thread Larry Bates
[EMAIL PROTECTED] wrote: > ello there. i am having a problem getting a module to work right. > > i wrote a class that is going to be used in a few different scripts in > the same directory. > > it looks like this: > > #!/usr/bin/python > > import MySQLdb > > class DbConnector(object): >

Re: about py2exe, I installed it, but can't find py2exe.exe in my computer.

2006-05-22 Thread Simon Brunning
On 22 May 2006 04:53:34 -0700, python <[EMAIL PROTECTED]> wrote: > it prompt: invalid command 'py2exe'. > I have import py2exe in setup.py file. Can you show us your setup.py file, the exact command that you typed, and the exact error message that you are getting? -- Cheers, Simon B, [EMAIL PR

Re: Software Needs Philosophers

2006-05-22 Thread Matt Garrish
"Mumia W." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Xah Lee wrote: >> Software Needs Philosophers >> >> by Steve Yegge, 2006-04-15. >> >> Software needs philosophers. >> >> [...] >> >> This post is archived at: >> http://steve-yegge.blogspot.com/2006/04/software-needs-ph

Re: problem with writing a simple module

2006-05-22 Thread nephish
ok, cool, and thanks very much. That worked. thanks for the info too. i am still new at the OO thing, just tired of doing a copy and paste over and over again. thanks again -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with writing a simple module

2006-05-22 Thread Larry Bates
[EMAIL PROTECTED] wrote: > ok, cool, and thanks very much. That worked. > thanks for the info too. > i am still new at the OO thing, just tired of doing a copy and paste > over and over again. > > thanks again > Glad that helped. The OO "stuff" does require a new set of understanding, but once y

Win32: Detecting when system is locked or sleeping

2006-05-22 Thread rodmc
I have written an application which works perfectly when the machine is operating under normal conditions, however when the screen becomes locked it imediately starts to fill up several hundred MB's of memory. Is there a way to detect when the system is locked? Best, rod -- http://mail.python

Testing for file type

2006-05-22 Thread Andrew Robert
Hi Everyone, Is there a way to test if a file is binary or ascii within Python? I'd prefer not to text against file extension. Any help you can provide would be greatly appreciated. Thanks, Andy -- http://mail.python.org/mailman/listinfo/python-list

enumerate() question

2006-05-22 Thread Gregory Petrosyan
Hello! I have a question for the developer[s] of enumerate(). Consider the following code: for x,y in coords(dots): print x, y When I want to iterate over enumerated sequence I expect this to work: for i,x,y in enumerate(coords(dots)): print i, x, y Unfortunately, it doesn't =( and I

Re: Testing for file type

2006-05-22 Thread Diez B. Roggisch
Andrew Robert wrote: > Hi Everyone, > > Is there a way to test if a file is binary or ascii within Python? try: open(filname).read().decode("ascii") ascii = True except UnicodeError: ascii = False Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate() question

2006-05-22 Thread Laurent Pointal
Gregory Petrosyan a écrit : > Hello! > I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > pr

Re: enumerate() question

2006-05-22 Thread Leif K-Brooks
Gregory Petrosyan wrote: > Hello! > I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > print

Re: enumerate() question

2006-05-22 Thread Damjan
> I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > print i, x, y for i, (x, y) in enumera

Re: enumerate() question

2006-05-22 Thread Diez B. Roggisch
Gregory Petrosyan wrote: > Hello! > I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > prin

Re: enumerate() question

2006-05-22 Thread Gregory Petrosyan
Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for file type

2006-05-22 Thread Laurent Pointal
Andrew Robert a écrit : > Hi Everyone, > > Is there a way to test if a file is binary or ascii within Python? > > I'd prefer not to text against file extension. > > Any help you can provide would be greatly appreciated. May look at unix "file" command sources... A+ L.Pointal. -- http://mail

XP64 64 Bit Linux and Programming Best Practice Guide

2006-05-22 Thread Wesley Brooks
Dear Users,Is there a version of python that will make full use of the 64 bit processing capabilities on XP64 or a 64 bit version of linux?Is there a particular version of linux best suited to coding in python and c++? Finally is there any references for programming best practice, for python or c++

Re: enumerate() question

2006-05-22 Thread Robert Kern
Gregory Petrosyan wrote: > Hello! > I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > print

RE: Win32: Detecting when system is locked or sleeping

2006-05-22 Thread Tim Golden
[rodmc] | I have written an application which works perfectly when the | machine is | operating under normal conditions, however when the screen becomes | locked it imediately starts to fill up several hundred MB's of memory. | | Is there a way to detect when the system is locked? This may not

Re: Win32: Detecting when system is locked or sleeping

2006-05-22 Thread skip
rod> I have written an application which works perfectly when the rod> machine is operating under normal conditions, however when the rod> screen becomes locked it imediately starts to fill up several rod> hundred MB's of memory. What do you mean by "locked"? Unresponsive to mous

Re: XP64 64 Bit Linux and Programming Best Practice Guide

2006-05-22 Thread Robert Kern
Wesley Brooks wrote: > Dear Users, > > Is there a version of python that will make full use of the 64 bit > processing capabilities on XP64 or a 64 bit version of linux? The coming Python 2.5 has loosened some 32-bit restrictions. http://www.python.org/dev/peps/pep-0353/ > Is there a particular

Re: Using python for a CAD program

2006-05-22 Thread David Cuthbert
baalbek wrote: > David Cuthbert wrote: >> This does not mean the design itself should be stored as an RDBMS. As >> I've stated previously, CAD data (both electrical and, it appears, >> mechanical) does not lend itself to RDBMS relationship modeling. > > I simply do not agree with this. > > A C

Re: problem with writing a simple module

2006-05-22 Thread nephish
yeah, i have thought of picking that one up. That one, or nutshell. i got programming python, which was way over my head, then learning python, which has helped me a great deal. thanks -- http://mail.python.org/mailman/listinfo/python-list

XML/HTML Encoding problem

2006-05-22 Thread Dale Strickland-Clark
A colleague has asked me this and I don't know the answer. Can anyone here help with this? Thanks in advance. Here is his email: I am trying to parse an HTML document using the xml.dom.minidom parser and then outputting a valid HTML document, all using the ISO-8859-1 charset. For example: My inp

Re: Win32: Detecting when system is locked or sleeping

2006-05-22 Thread Dale Strickland-Clark
[EMAIL PROTECTED] wrote: > > rod> I have written an application which works perfectly when the > rod> machine is operating under normal conditions, however when the > rod> screen becomes locked it imediately starts to fill up several > rod> hundred MB's of memory. > > What do you

Re: Win32: Detecting when system is locked or sleeping

2006-05-22 Thread rodmc
Yes, I mean just a good old fashioned screen lock (for security) initiated by the user. 'Sadly' there has been nothing as exciting as a blue-screen of death as yet, not even when the app swells to 400MB. Best, rod -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
"I guess for better or worse, Flash is a very different mindset and approach to the web." I do find it interesting that Flash folks readily will acknowledge that Flash has shortcomings, yet anti-Flash folks seem to have great difficulty acknowledging Flash's positive features over HTML. Such situ

How does a generator object refer to itself?

2006-05-22 Thread Russell
This is more a Python 2.5 question, since it is the send() method that makes this so useful. The issue is how to write a generator that refers to its own generator object. This would be useful when passing control to some other function or generator that is expected to return control via a send():

Re: string.count issue (i'm stupid?)

2006-05-22 Thread Tim Chase
I agree the docstring is a bit confusing and could be clarified as to what's happening > Can someone explain me this? And in which way i can count all > the occurrence of a substring in a master string? (yes all > occurrence reusing already counter character if needed) You should be able to us

Re: Python - Web Display Technology

2006-05-22 Thread Paul Rubin
"SamFeltus" <[EMAIL PROTECTED]> writes: > I do find it interesting that Flash folks readily will acknowledge that > Flash has shortcomings, yet anti-Flash folks seem to have great > difficulty acknowledging Flash's positive features over HTML. Such > situations always make me suspicious Ludditism

Re: XML/HTML Encoding problem

2006-05-22 Thread Sybren Stuvel
Dale Strickland-Clark enlightened us with: > So it encodes the entity reference to € (Euro sign).  I need it to > remain as € so that the resulting HTML can render properly in > a browser. If you want proper display, why not use UTF-8? Sybren -- The problem with the world is stupidity. Not sa

Re: Python - Web Display Technology

2006-05-22 Thread Sybren Stuvel
SamFeltus enlightened us with: > I do find it interesting that Flash folks readily will acknowledge > that Flash has shortcomings yet anti-Flash folks seem to have great > difficulty acknowledging Flash's positive features over HTML. I must say I've never seen a pro-Flash person acknowledging that

Re: XML/HTML Encoding problem

2006-05-22 Thread Duncan Booth
Dale Strickland-Clark wrote: > from xml.dom.minidom import parseString > output = parseString(strHTML).toxml() > > The output is: > > > > > >http-equiv="Content-Type"/> > > € > > > > So it encodes the entity reference to € (Euro sign).  I need it to > remain as € so that the resulting HTM

Vancouver Python Workshop - registration open

2006-05-22 Thread Brian Quinlan
What's New? === Early-bird registration for the Vancouver Python conference is now open. Participants who register before June 30th will receive a substantial discount. To register, see: http://www.vanpyz.org/conference/registration For general conference information, see: http://www.v

Re: Testing for file type

2006-05-22 Thread BartlebyScrivener
In the Python Cookbook, 2ed, page 25, there's a script by Andrew Dalke that uses the same heureistic criteria that Perl does and analyzes a string and deems it binary if it contains any nulls or if more than 30% of its characters have the high bit set or are strange control codes. There's a follow

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
I don't agree with 99.9%, but the majority of Flash sites are done poorly. Mine is certainly sub-optimal, :) 1. Loss of back button Isn't this really a myth? A page with a time dimension, be it Flash, HTML/JS or whatever, breaks the back button. A page without a time dimension doesn't break the

Re: Python - Web Display Technology

2006-05-22 Thread SamFeltus
Perhaps the my question should be this, and don't get me wrong, I REALLY like Python. Perhaps Python is not a great language to focus on for someone with a strong interest in Flash and little interest in HTML? -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (May 22)

2006-05-22 Thread Peter Otten
QOTW: "It's hard to make a mistake by having too many short and simple functions. And much too easy to make them when you have too few ;-)" - Thomas Bartkus "Argh, the following is valid Python syntax: assert a is not b - XXX in-progress" - Armin Rigo (found on Michael Hudson's blog) A GR

Re: problem with writing a simple module

2006-05-22 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > ello there. i am having a problem getting a module to work right. > > i wrote a class that is going to be used in a few different scripts in > the same directory. > > it looks like this: > > #!/usr/bin/python This is not needed for a module. (snip code) > the file is

Re: string.count issue (i'm stupid?)

2006-05-22 Thread BartlebyScrivener
We were doing something like this last week thestring = "a_a_a_a_" >>> for x in range(len(thestring)): ... try: ... thestring.count("_a_", x, x + 3) ... except ValueError: ... pass -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - Web Display Technology

2006-05-22 Thread Paul Rubin
"SamFeltus" <[EMAIL PROTECTED]> writes: > As for the blind issue,that makes no sense to me. Is the suggestion > that we should give up using images in web sites since some people > can't see them. Might as well throw out the use of the img tag while > we are at it? Img tags should always have al

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
OK no question. I'm only posting b/c it may be something another newbie will want to google in the future. Now that I've worked thru the process this turns out to be fairly easy. However, if there are better ways please let me know. Module = ClassVars.py import copy class ClassVars(type): c

[ANN] pglib 0.1

2006-05-22 Thread Manlio Perillo
I'm pleasant to announce the first public release of pglib. pglib is an implementation of the PostgreSQL protocol, version 3.0. It is written in Twisted, and aims to be a complete replacement for libpq. In the current version the extended query sub protocol is not supported. The project can be f

Re: Python - Web Display Technology

2006-05-22 Thread Blair P. Houghton
Sybren Stuvel wrote: > Heiko Wundram enlightened us with: > > And: the web is a platform to offer _information_. Not to offer > > shiny graphics/sound [...] > > Many would disagree... > > Not me, but I know a lot of people that would. I would. Most people would, once they realize that shiny/flas

Re: Python - Web Display Technology

2006-05-22 Thread dingbat
SamFeltus wrote: > Here is a visual argument, > http://samfeltus.com/swf/contact_globes.swf Here's a text-based argument. If I search Golge for "gardener, Athens, GA" then Google's spiders won't have recorded your contact page. So I don't find you as a local gardener, so I don't hire you for my

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Edward Elliott
bruno at modulix wrote: > Edward Elliott wrote: >> You mean like this: >> >> s = "foo" + "bar" >> s = 'foo' + 'bar' >> s = 'foo' 'bar' >> s = '%s%s' % ('foo', 'bar') [snip] > The real mantra is actually : > "There should be one-- and preferably only one --obvious way to do it" > > Please note th

Re: Using metaclasses to inherit class variables

2006-05-22 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > OK no question. I'm only posting b/c it may be something another newbie > will want to google in the future. Now that I've worked thru the > process this turns out to be fairly easy. > > However, if there are better ways please let me know. > > Module = ClassVars.py >

Re: Python - Web Display Technology

2006-05-22 Thread Edward Elliott
SamFeltus wrote: > 1. Loss of back button > Isn't this really a myth? A page with a time dimension, be it Flash, > HTML/JS or whatever, breaks the back button. A page without a time > dimension doesn't break the back button. Should we now and forever > more give up the time dimension to avoid b

COM Server crashing when returning large arrays

2006-05-22 Thread Alastair Alexander
Hi ... I'm using pythoncom to create a python COM server application that needs to be able to return large arrays to COM client apps. For example, I need to be able to return an array to Excel that is 500 by 10, with each element of the array holding a 32 byte string. If I run the code for smal

MAC Laptop right click/drag mouse button TKinter

2006-05-22 Thread spohle
hi, i programmed a small app with TK and use TK. some of the functions are called with events like rightDrag and rightClick on an item on the canvas. that works fine on a pc. on my mac laptop i only have the one button, so im used to use CTRL+ Mouse Button. that doesn't work with TK. any ideas ho

Re: PHP's openssl_sign() using M2Crypto?

2006-05-22 Thread heikki
KW wrote: > The openssl module in PHP basicly does this (C code): > EVP_SignInit(&md_ctx, EVP_sha1()); > EVP_SignUpdate(&md_ctx, data, data_len); > EVP_SignFinal(&md_ctx, sigbuf, &siglen, pkey); > > Looks like some magic is used to get pkey, I think that's what I'm missing. > See php_openssl_

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
Much better. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Software Needs Philosophers

2006-05-22 Thread vjg
nikie wrote: > > (BTW: Have you ever considered the possibility that philosophers might > not be interested in tab-versus-spaces-debates in the first place? > Maybe they have more interesting matters to discuss. Just like the rest > of us.) Debate? There's no valid dabate. Tabs bad. Spaces good.

Re: performance difference between OSx and Windows

2006-05-22 Thread Scott David Daniels
Brian wrote: > As one additional question, can someone point me in the direction of a > resource that would explain how I could use Python to tell me what core > is actually handling the process? I am not even sure if something like > this exists, but it would be an interesting feature to explore.

Re: Using metaclasses to inherit class variables

2006-05-22 Thread [EMAIL PROTECTED]
Oops! This isn't working. As the sequence I'm trying for is >>> def set_classvars(**kwargs): ... def __metaclass__(name, bases, classdict): ... for name, value in kwargs.iteritems(): ... if name not in classdict: ... classdict[name] = value ...

Re: Software Needs Philosophers

2006-05-22 Thread Carl J. Van Arsdall
vjg wrote: > nikie wrote: > >> (BTW: Have you ever considered the possibility that philosophers might >> not be interested in tab-versus-spaces-debates in the first place? >> Maybe they have more interesting matters to discuss. Just like the rest >> of us.) >> > > Debate? There's no valid d

Class probkem - getting msg that self not defined

2006-05-22 Thread Andrew Robert
Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) var = test.decode(self.qname) I would have thought that self would have carried forward when I

manual http request

2006-05-22 Thread Steve Young
Hi, I was wondering if there's a way to mimic a web pages' form and just manually send the http request and get the html response without having to go through a browser. For example, lets say i wanted to make a search on google of the key word "cars" but i want to be able to get the results of

Re: Class probkem - getting msg that self not defined

2006-05-22 Thread wes weston
Andrew Robert wrote: > Hi Everyone, > > I am having a problem with a class and hope you can help. > > When I try to use the class listed below, I get the statement that self > is not defined. > > test=TriggerMessage(data) self is not known here; only inside the class. > var = tes

  1   2   >