Re: Prevent Modification of Script?

2007-04-04 Thread Michael Ekstrand
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

Re: how can I invoke a Java code?

2007-03-22 Thread Michael Ekstrand
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 choice

Re: to thine own SELF be true...

2006-05-05 Thread Michael Ekstrand
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

Re: How do I take a directory name from a given dir?

2006-05-01 Thread Michael Ekstrand
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 that needs

Re: set partitioning

2006-05-01 Thread Michael Ekstrand
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:

Re: freakin out over C++ module in python

2006-04-18 Thread Michael Ekstrand
[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

Re: zlib and zip files

2006-04-14 Thread Michael Ekstrand
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: unknown

Re: pre-PEP: The create statement

2006-04-06 Thread Michael Ekstrand
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 I'm not

Re: pre-PEP: The create statement

2006-04-06 Thread Michael Ekstrand
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 Title: The

Re: pre-PEP: The create statement

2006-04-06 Thread Michael Ekstrand
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 to extend this to other things, so

Re: RELEASED Python 2.5 (alpha 1)

2006-04-05 Thread Michael Ekstrand
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

Re: RELEASED Python 2.5 (alpha 1)

2006-04-05 Thread Michael Ekstrand
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 the question of can I implement Scheme's call

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-04-01 Thread Michael Ekstrand
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

Re: Content Management System

2006-03-29 Thread Michael Ekstrand
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 they

Re: Uninstalling Python

2006-03-29 Thread Michael Ekstrand
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 would you recommend that I

Re: SSL/TLS - am I doing it right?

2006-03-14 Thread Michael Ekstrand
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

Re: Which GUI toolkit is THE best?

2006-03-11 Thread Michael Ekstrand
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 to program

Re: Python IDE: great headache....

2006-03-11 Thread Michael Ekstrand
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. Only 2

Re: RAD tutorials and tools for GUI development with Python?

2006-03-08 Thread Michael Ekstrand
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 coding

Re: Suggestions for documentation generation?

2006-03-02 Thread Michael Ekstrand
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. Looks

Re: wxPython memory footprint? - Re: Write a GUI for a python script?

2006-03-02 Thread Michael Ekstrand
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 shell

Re: how do you move to a new line in your text editor?

2006-03-02 Thread Michael Ekstrand
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 around

Re: C++ OpenGL rendering, wxPython GUI?

2006-02-28 Thread Michael Ekstrand
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 python

Re: HTML/DOM parser

2006-02-28 Thread Michael Ekstrand
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

Re: Python vs Ruby

2005-10-21 Thread Michael Ekstrand
On Friday 21 October 2005 07:07, bruno modulix wrote: Python is more like Java. troll Err... Python is more like what Java would have been if Java was a smart dynamic hi-level object oriented language !-) /troll +1. Python is easily applicable to most of the problem domain of Java, but

Re: UI toolkits for Python

2005-10-17 Thread Michael Ekstrand
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

Re: Node Subtree

2005-10-14 Thread Michael Ekstrand
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 another

Re: Well written open source Python apps

2005-10-13 Thread Michael Ekstrand
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 well

Re: UI toolkits for Python

2005-10-13 Thread Michael Ekstrand
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 started

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-07 Thread Michael Ekstrand
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

Re: /usr/bin/env python, force a version

2005-10-06 Thread Michael Ekstrand
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 ?

Re: So far (about editing tools)

2005-10-06 Thread Michael Ekstrand
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 it for

Re: Controlling who can run an executable

2005-10-04 Thread Michael Ekstrand
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 add

Re: how to debug when Segmentation fault

2005-10-04 Thread Michael Ekstrand
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

Re: cgi relay for python cgi script

2005-10-04 Thread Michael Ekstrand
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. What

Re: how to debug when Segmentation fault

2005-10-04 Thread Michael Ekstrand
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 an extension module I was using the other week (lxml

Re: wxPython equiv. to tag_configure

2005-10-04 Thread Michael Ekstrand
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

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Michael Ekstrand
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't

Re: What python idioms for private, protected and public?

2005-09-29 Thread Michael Ekstrand
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

Re: converting Word to MediaWiki

2005-09-29 Thread Michael Ekstrand
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

Re: A rather unpythonic way of doing things

2005-09-29 Thread Michael Ekstrand
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 into

Re: Metaclasses, decorators, and synchronization

2005-09-27 Thread Michael Ekstrand
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 --

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Michael Ekstrand
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

Re: Python Programming

2005-09-26 Thread Michael Ekstrand
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 anyone

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Michael Ekstrand
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):

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Michael Ekstrand
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

Re: Metaclasses, decorators, and synchronization

2005-09-25 Thread Michael Ekstrand
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 - was

Metaclasses, decorators, and synchronization

2005-09-24 Thread Michael Ekstrand
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

Re: Editing The Registery

2005-09-24 Thread Michael Ekstrand
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

Re: Perl's documentation come of age

2005-09-21 Thread Michael Ekstrand
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 troll

Re: vendor-packages directory

2005-09-20 Thread Michael Ekstrand
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

Re: C#3.0 and lambdas

2005-09-19 Thread Michael Ekstrand
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 to

Re: How to protect Python source from modification

2005-09-12 Thread Michael Ekstrand
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

Re: What's the difference between VAR and _VAR_?

2005-09-10 Thread Michael Ekstrand
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

Re: OpenSource documentation problems

2005-09-10 Thread Michael Ekstrand
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 the

Re: Python versus Perl

2005-09-06 Thread Michael Ekstrand
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

Re: Epydoc - Documenting class members?

2005-09-02 Thread Michael Ekstrand
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 how to

Re: .pth files in working directory

2005-08-31 Thread Michael Ekstrand
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 top is. To

Re: graphical or flow charting design aid for python class development?

2005-08-31 Thread Michael Ekstrand
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

Re: python xml DOM? pulldom? SAX?

2005-08-29 Thread Michael Ekstrand
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 page

Re: Email client in Pyhton

2005-08-24 Thread Michael Ekstrand
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 in

Re: Is mymodule.myvariable a 'global'? (What is proper definition of 'global variable'?)

2005-08-21 Thread Michael Ekstrand
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 to be

Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
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

Re: Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
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() serializes them to

Re: Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
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 a

Extending and altering httplib to handle bad servers

2005-08-08 Thread Michael Ekstrand
response_class Req-started-unread-response_CS_REQ_STARTEDresponse_class Req-sent-unread-response _CS_REQ_SENT response_class + + Modified 2005-07-20 by Michael Ekstrand [EMAIL PROTECTED] to deal + gracefully wtih non-compliant systems which just terminate the connection