I've been googling around for a bit trying to find some mechanism for
doing in Python something like Java's synchronized methods. In the
decorators PEP, I see examples using a hypothetical synchronized
decorator, but haven't stumbled across any actual implementation of
such a decorator. I've al
On Saturday 24 September 2005 15:04, Eyual Getahun wrote:
> I was wondering how could I edit the registery with python
The excellent manual tells you how...
The _winreg module
http://docs.python.org/lib/module--winreg.html
-Michael
--
http://mail.python.org/mailman/listinfo/python-list
On Sunday 25 September 2005 22:30, Victor Ng wrote:
> You could do it with a metaclass, but I think that's probably
> overkill.
OK. And thanks for the example :-). It looks simple enough... I didn't
think the solution would be overly complex. And the RLock makes it
easier than I anticipated - wa
On Sep 26, 2005, at 1:46 PM, David Edwards wrote:
> I've got a short, simple Python script that is
> supposed to read a midi file and produce a text file
> of note and volume information, then render that info
> in another program.
>
> Unfortunately, I can't get it to work, so I was
> wondering if
On Sep 26, 2005, at 2:16 PM, Tom Anderson wrote:
> You could define a meta-lock, and use that to protect the
> lock-installation action.
Something like this (not yet tested):
import threading
global_lock = threading.Lock()
def synchronized(meth):
def inner(self, *args, **kwargs):
On Sep 26, 2005, at 4:21 PM, Scott David Daniels wrote:
> Unnecessarily holding a lock while acquiring another can be a nasty
> source of deadlock or at least delay. Another source of problems is
> holding a lock because an exception skipped past the release code.
I had thought of part of that af
On Tuesday 27 September 2005 00:22, Michele Simionato wrote:
> It is not that easy, but you can leverage on my decorator module
> which does exactly what you want:
> http://www.phyast.pitt.edu/~micheles/python/decorator.zip
Excellent. Thank you :-).
- Michael
--
http://mail.python.org/mailman/li
On Sep 27, 2005, at 12:45 PM, Kenneth McDonald wrote:
> It's too bad that there is no equivalent of d'oxygen for Python. That
> is a _nice_ program.
I've been using epydoc (http://epydoc.sourceforge.net) for a while now,
and it's really nice. The output is very much in the style of Javadoc.
Its
On Thursday 29 September 2005 03:57, Paul Rubin wrote:
> I can't think of a single time that I've ever seen a legitimate use
> of name mangling to reach from one class into another in a Python
> application (I don't count something like a debugger). If you're got
> some concrete examples I wouldn'
On Thursday 29 September 2005 09:08, Michael Schneider wrote:
> Design Intent:
>
> 1) mark an object as dirty in a setter (anytime the object is
> changed, the dirty flag is set without requiring a user to set the
> dirty flag
2 ways: wrap every attribute that is to be set in a property object (in
On Thursday 29 September 2005 07:43, Peter Hansen wrote:
> Are the two necessarily in conflict? Perl can save your butt and
> _still_ suck!
Hear, hear!
Although I think it's the vi user in me that makes me like Perl...
- Michael
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday 29 September 2005 04:53, Peter Corbett wrote:
> One of my friends has recently taken up Python, and was griping a bit
> about the language (it's too "prescriptive" for his tastes). In
> particular, he didn't like the way that Python expressions were a bit
> crippled. So I delved a bit i
On Tuesday 04 October 2005 01:43, Svennglenn wrote:
> Have the program check for a file hidden somewhere on the computer.
> For instance, if the file dummyfile.dll doesn't exist in the
> windows/system32 folder the program just doesn't start. And when you
> install the program on her computer just
On Tuesday 04 October 2005 11:13, Maksim Kasimov wrote:
> my programm sometime gives "Segmentation fault" message (no matter
> how long the programm had run (1 day or 2 weeks). And there is
> nothing in log-files that can points the problem. My question is how
> it possible to find out where is the
On Oct 4, 2005, at 2:35 AM, Amir Michail wrote:
> Is there an easy way to execute a python cgi script on a different
> machine from the cgi server?
>
> I could write my own server, but I was wondering if something is
> available that would allow me to use a cgi script as is without
> modification.
On Oct 4, 2005, at 2:08 PM, Jp Calderone wrote:
> On Tue, 4 Oct 2005 11:22:24 -0500, Michael Ekstrand
> <[EMAIL PROTECTED]> wrote:
>> I've never seen "stock" Python (stable release w/ only included
>> modules)
>> segfault, but did see a segfault with
On Oct 4, 2005, at 3:11 PM, ncf wrote:
> In the wxWidgets manual, I see a wxHtmlWindow object, but nothing like
> that seems to exist when I dir() wxPython.
wxHtmlWindow is in the wx.html module.
-Michael
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday 06 October 2005 06:25, [EMAIL PROTECTED] wrote:
> I hope you understand my needs. Is there a python/bash mechanism to
> override the default python version of the system ... and run the
> script with any version of python (but the most recent) ?
> or can you explain me how to do that ?
On Thursday 06 October 2005 15:45, Micah Elliott wrote:
> On Oct 06, Kenneth McDonald wrote:
> > The only _real_ problem is the eclipse learning curve.
>
> The only real *advantage* of Eclipse (over other suggested tools) is
> its highly hyped automatic refactoring. Admittedly, I have not used
> i
On Friday 07 October 2005 08:56, Eric Nieuwland wrote:
> Ever cared to check what committees can do to a language ;-)
*has nasty visions of Java*
Hey! Stop that!
- Michael
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday 13 October 2005 09:43, Ben wrote:
> Could anyone suggest an open source project that has particularly
> well written Python? I am especially looking for code that people
> would describe as "very Python-ic". (Not trying to start any kind of
> war - just wanted some good examples of a
On Thursday 13 October 2005 15:17, Kenneth McDonald wrote:
> 1) Which plays best with Python? Ideally, it would already have some
> higher-level python libraries to hide the grotty stuff that is almost
> never needed when actually implementing apps.
wxPython plays reasonably well.
I've just start
On Friday 14 October 2005 08:40, Vinci wrote:
> I'm using Python to work on Xml documents importing the minidom
> module: in particular I need to get the whole subtree rooted at a
> given node "n".
>
> Does anyone know whether there is a way to find it with a function
> /class or by importing anoth
On Monday 17 October 2005 12:19, Kenneth McDonald wrote:
> 1) A real word processor.
Difficult. Not necessarily impossible. Would require much cleverness.
And it wouldn't be capable of everything Word can do.
> 2) Keybindings in a web application
Not sure here, but JavaScript may be able to do
On Friday 21 October 2005 07:07, bruno modulix wrote:
> >>Python is more like Java.
>
>
> Err... Python is more like what Java would have been if Java was a
> smart dynamic hi-level object oriented language !-)
>
+1. Python is easily applicable to most of the problem domain of Java,
but solves
E
Req-started-unread-response_CS_REQ_STARTED
Req-sent-unread-response _CS_REQ_SENT
+
+ Modified 2005-07-20 by Michael Ekstrand <[EMAIL PROTECTED]> to deal
+ gracefully wtih non-compliant systems which just terminate the connection
+ rather than sending the end-
On 12 Aug 2005 09:31:08 -0700
"yaffa" <[EMAIL PROTECTED]> wrote:
> addr = incident.findNextSibling('td')
> addr.append('%s;')
addr += ';'
or
addr2 = '%s;' % addr
Strings, being immutable, do not support appending like lists do. Also,
the %whatever specifiers are only in effect when used with t
Hello all,
In my current project, I am working with XML data in a protocol that has
checksum/signature verification of a portion of the document. There is
an envelope with a header element, containing signature data; following
the header is a body. The signatures are computed as cryptographic
c
On Aug 19, 2005, at 12:11 PM, Will McCutchen wrote:
>> In my current project, I am working with XML data in a protocol that
>> has
>> checksum/signature verification of a portion of the document.
>> ...
>> the server sends me XML with empty elements as full open/close tags,
>> but toxml() serializ
On Aug 19, 2005, at 1:20 PM, Robert Kern wrote:
> Read up on XML canonicalization (abrreviated as c14n). lxml implements
> this, also xml.dom.ext.c14n in PyXML. You'll need to canonicalize on
> both ends before hashing.
>
> To paraphrase an Old Master, if you are running a cryptographic hash
> over
On 21 Aug 2005 09:45:26 -0700
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Python lets me access module level variables from *anywhere*. All I
> have
> to do is add module name in front.
>
> e.g.
>
> mymodule.myvariable
>
> Is this considered a 'global'? Or, does a 'global variable' have t
On Wed, 24 Aug 2005 20:15:01 +0530 (IST)
[EMAIL PROTECTED] wrote:
> now i am planning to write a bear minimum email client in
> pyhton. i found the smtp module of python could serve my
> pupose. I can send message using mails using the smtp lib.
> Now i'm looking for some modules which can help me
On 29 Aug 2005 08:17:04 -0700
"jog" <[EMAIL PROTECTED]> wrote:
> I want to get text out of some nodes of a huge xml file (1,5 GB). The
> architecture of the xml file is something like this
> [structure snipped]
> I want to combine the text out of page:title and page:revision:text
> for every single
On Wed, 31 Aug 2005 15:07:41 +0200
Peter Maas <[EMAIL PROTECTED]> wrote:
> I want a tree
>
> top/
> install.py
> sub1/
> __init__.py
> mod1.py
> sub2/
> mod2.py
>
> where I can do "from sub1 import mod1" in mod2.py no matter what the
> absolute path of to
On Wed, 31 Aug 2005 15:40:52 GMT
William Gill <[EMAIL PROTECTED]> wrote:
> Being somewhat new to Python, and having a tendency to over
> complicate things in my class design, I was wondering if anyone can
> suggest a simple graphical or flowcharting tool that they use to
> organize their class and
On Sep 1, 2005, at 3:18 PM, BBands wrote:
> Something like:
>
> class master:
> def __init__(self, list):
> self.count = len(list)
> for line in list:
> self.line = [] # obviously this doesn't work
No, but this does:
class master:
def __init__(self, lst):
On Thu, 1 Sep 2005 22:38:03 -0500
Terry Hancock <[EMAIL PROTECTED]> wrote:
> > I don't like this, I want to document where I declare the variable
> > below. Doxygen (www.doxygen.org), for one example, knows how to do
> > this.
>
> Then use Doxygen if it's a superior product. I presume
> it knows h
I don't have any benchmark/performance data available, so I'll pass on
those questions, but I'll take a stab at the third (being reasonably
fluent in both languages).
On Sep 6, 2005, at 12:03 PM, Dieter Vanderelst wrote:
> 3 - In my opinion Python is very well suited for text processing. Does
>
On 8 Sep 2005 22:48:05 -0700
"Johnny Lee" <[EMAIL PROTECTED]> wrote:
> I thought there must be something special when you named a VAR with
> '_' the first character. Maybe it's just a programming style and I had
> thought too much...
It is just a programming style issue. In Python, variables and f
On Fri, 09 Sep 2005 18:16:36 -0400
Mike Meyer <[EMAIL PROTECTED]> wrote:
> You need a better browser. Mine - at least on Unix - have an option to
> dump textareas into text files, invoke my favorite editor on them, and
> then read the file back in when the editor exits. Assuming i'm not
> running t
On Sep 12, 2005, at 11:26 AM, Frank Millman wrote:
> If I move all the authentication and business logic to a program which
> runs on the server, it is up to the system administrator to ensure that
> only authorised people have read/write/execute privileges on that
> program. Clients will have no p
On Monday 19 September 2005 08:18, Roel Schroeven wrote:
> def drawline((x1, y1), (x2, y2)):
> # draw a line from x1, y1 to x2, y2
> foo(x1, y1)
> bar(x2, y2)
Yow! I did not know you could even do this.
My vote would be +1 for keeping them in the language... they look far
too useful
On Tuesday 20 September 2005 10:22, Rich Burridge wrote:
> [lots of well-written and logical information about a proposed
> vendor-packages directory snipped]
> Is this something that would be considered for a future Python
> release?
+1 to that from me... it looks like good idea - have you submi
On Wednesday 21 September 2005 05:41, Xah Lee wrote:
> One easy way to test this, is for Pythoners to read Perl docs and
> vice versa.
>
> Pythoners will find that, you really don't know what the fuck the
> Perlers are talking about. Same with Perler with Python docs.
At the risk of feeding the tr
On 28 Feb 2006 01:14:15 -0800
[EMAIL PROTECTED] wrote:
> I'm creating a scientific visualization application with rather high
> demands on performance. I've created a nice rendering engine for it in
> C++/OpenGL and a python interface to the rendering engine. Now I'm
> looking to build a GUI in pyt
On 28 Feb 2006 00:33:11 -0800
"Xah Lee" <[EMAIL PROTECTED]> wrote:
> is there a module that lets me parse validated html files and store it
> as a tree?
BeautifulSoup will parse valid HTML (not just XHTML), and also crummy
HTML while it's at it. And generates a tree structure. Warning: I
haven't a
On 2 Mar 2006 04:06:17 -0800
"kpd" <[EMAIL PROTECTED]> wrote:
> Thanks - I took at both. Also at 'percepts', which I used a long time
> ago (had forgotten about it). Percepts has a great little java applet
> for viewing the class hierarchy. I don't think it works for python,
> just C++ though. L
On Thu, 02 Mar 2006 19:52:34 +0100
robert <[EMAIL PROTECTED]> wrote:
> Can you debug & call functions interactively from e.g. Pythonwin while a
> wxPython app is running.
It's a snap to incorporate a nice GUI Python shell with object browser
into any wxPython app - wxPython provides its PyCrust s
On Thu, 02 Mar 2006 18:39:55 GMT
John Salerno <[EMAIL PROTECTED]> wrote:
> But I read in the PEP that spaces are recommended over tabs. If this is
> the case, it would involve pressing backspace 4 times (or 8, etc.) to
> get back to column 1.
>
> So I'm wondering, how do you all handle moving ar
On Thu, 22 Mar 2007 17:49:01 -0700, momobear wrote:
> A friend of my write a Java program, and I want use it in my python
> program as a module. I searched the topic in Google and find maybe the
> better way is use GCJ to compile it. Is there any other way for me? the
> simple and speediness choic
On Wed, 04 Apr 2007 18:04:57 -0700, ts-dev wrote:
> Is it possible to prevent modification of a python file once its been
> deployed? File permissions of the OS could be used..but that doesn't
> seem very secure.
>
> The root of my question is verifying the integrity of the application
> and the
[EMAIL PROTECTED] wrote:
> i would go thru it line by line, but i just dont know enough about C++,
> how it pulls off a socket connection, etc.. and some of the things i
> dont know how to do in python. like how to make an unsigned long init.
The networking code in C++ should be at least vaguely s
On Mon, May 01, 2006 at 12:42:58PM -0700, Merrigan wrote:
> The issue I am currently having isto "extract" the directory name from
> a given directory string. For example: from the string
> "/home/testuser/projects/" I need to extract the "projects" part. The
> problem is that the directory names t
On Mon, May 01, 2006 at 03:42:53PM -0700, [EMAIL PROTECTED] wrote:
> Not quite what I'm looking for. I would like a list of all partitions
> with each partition having k or less elements, not just one instance.
def partition(S, k):
parts = []
ct = 0
cp = []
for elem in S:
On Fri, May 05, 2006 at 05:08:24PM +, Mark Harrison wrote:
> Is there a way to get rid of those the "self." references, or is this
> just something I need to get my brain to accept?
It's pretty much just something you'll need to get your brain to accept.
You can replace self with something sho
On Wed, 8 Mar 2006 04:51:17 -0600
"Arthur Pemberton" <[EMAIL PROTECTED]> wrote:
> I would really like to code a few more widely useable apps, but
> coding the GUI just seems so boring and unnecessarily complex. Maybe
> I was spoilt by Borland's Delphi/Kylix. But is there any way to do as
> little c
On Sat, 11 Mar 2006 00:07:52 +0100
Alan Franzoni <[EMAIL PROTECTED]> wrote:
> > again to make a choice is difficult; is there also some guy liking
> > pyqt is it worse or should it be avoided because of the licencing
> > policy for qt (which I also like..)?
> >
> > * Which one is the most fun
On Sun, 12 Mar 2006 01:03:36 +0100
Rene Pijlman <[EMAIL PROTECTED]> wrote:
> >5. Debugging: Breakpoints, conditional pause. watch for
> >variables.step into, over and out of a function.
>
> Yes.
I'll second the recommendation of Wing's debugging. Best debugger I've
seen, any language, period. Onl
Disclaimer: I am not an expert. Take this with a grain of salt... but
I'll throw it out for what it's worth.
On 14 Mar 2006 04:12:38 -0800
"Frank Millman" <[EMAIL PROTECTED]> wrote:
> > > Using openssl, generate a key for the server, generate a
> > > self-signed certificate, and extract the sha1 f
Water Cooler v2 wrote:
> So, again, where are the boundaries? What about non-public content?
> What about access rights? Do you have seperate users on CMS's having
> their seperate folders as well, where they could put their own private
> content? Or, is the idea behind CMS about "sharing" and so t
Pete wrote:
> Ben Finney wrote:
>> "Pete" <[EMAIL PROTECTED]> writes:
>>
>>> I googled "python" and have no interest in it and know nothing about
>>> it.
>>>
>>> Therefore, I would like to uninstall both the versions since I do
>>> not believe I need them. Would it be okay to uninstall them or
>>
Jack Diederich wrote:
> Xah, is that you?
Nope, can't be. Xah doesn't use caps like that, and Xah also is very big
Free Software not Open Source...
Xah also tends to communicate in a slightly more intelligent fashion.
(note: do not take this as a defense of Xah)
- Michael
--
mouse, n: a dev
After reading AMK's survey of what's new in Python 2.5, I am suitably
impressed. As usual, I can't wait to start using the cool new
features... extended generators? (mind is currently swimming with the
question of "can I implement Scheme's call-with-current-continuation
using extended generato
Michele Simionato wrote:
> Michael Ekstrand wrote:
>> After reading AMK's survey of what's new in Python 2.5, I am suitably
>> impressed. As usual, I can't wait to start using the cool new
>> features... extended generators? (mind is currently swimming with
Carl Banks wrote:
> That's probably even more readable than class A, if not as familiar.
> My biggest concern with this is the special arguments of the caller.
> It breaks my heart that we couldn't do something like this:
>
> create dict keymap:
> A = 1
> B = 2
>
Why couldn't you? Maybe
Steven Bethard wrote:
> The PEP below should be mostly self explanatory. I'll try to keep the
> most updated versions available at:
>
> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt
> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html
>
>
>
> PEP: XXX
> Ti
Steven Bethard wrote:
> Michael Ekstrand wrote:
>> Something it could be useful to try to add, if possible: So far, it
>> seems that this create block can only create class-like things (objects
>> with a name, potentially bases, and a namespace). Is there a natural way
>&
Jan Prochazka wrote:
> Hi,
> I need to decompress zip archive. I wrote a parser of zip file, i obtain
> the compressed data, but when i call zlib.decompress(data) on them,
> it throws this error:
>
> decbuf = decompressor.decompress(compressed_data)
>
> error: Error -3 while decompressing: unknow
68 matches
Mail list logo