Re: Basic python help

2006-03-13 Thread John M. Gabriele
(Please don't top-post -- fixed) Kevin Feng wrote: > > > On 3/14/06 2:12 AM, in article [EMAIL PROTECTED], > "Gregor Horvath" <[EMAIL PROTECTED]> wrote: > > >>Kevin Feng schrieb: >> >> >>>More information about this error may be available in the server error log. >>> >>> >>> >>>Any suggestion

Re: Basic python help

2006-03-13 Thread Kevin Feng
No idea, I do not have permission to access the error log. On 3/14/06 2:12 AM, in article [EMAIL PROTECTED], "Gregor Horvath" <[EMAIL PROTECTED]> wrote: > Kevin Feng schrieb: > >> More information about this error may be available in the server error log. >> >> >> >> Any suggestions? Much

Re: doctest-alike for a unix shell?

2006-03-13 Thread Paddy
Thanks for the pointer to dejagnu, although it is not what I was after. The question came about because I was scripting an interface to an electronics design automation tool that comes with a TCL interface. I was using a companion perl script called from the TCL to do most of the more complex chec

Re: markov query

2006-03-13 Thread Stefan Behnel
Don't know of a Python module (although this doesn't look complex enough for a package anyway...), but kpp9c wrote: > P.S. Does any one know first of all whether these are called markov > tables, transition tables or probability tables? I am not sure i am > referring to this correctly and what the

Re: Basic python help

2006-03-13 Thread Gregor Horvath
Kevin Feng schrieb: > More information about this error may be available in the server error log. > > > > Any suggestions? Much thanks. > What does the error log of the webserver say? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Basic python help

2006-03-13 Thread Kevin Feng
Title: Basic python help I have the following simple html file that is trying to send data to a python script, however, I am getting a weird server error: This is my HTML: Ticker 1 This is my Python: #!/usr/bin/python import cgi print "Content-type: text/html" print form = cgi.Fi

Memory visualization

2006-03-13 Thread bearophileHUGS
Icon is a language that share some similarities with Python: http://www.cs.arizona.edu/icon/ During the execution of a Icon script there are ways to visualize the memory: http://www.cs.arizona.edu/icon/progvis/memmon/memmon.htm Related pages: http://www.cs.arizona.edu/icon/progvis/workshop/worksh

catching java program return

2006-03-13 Thread eight02645999
hi i have to run a java program inside my python script. i have some java classes declared: os.environ['CLASSPATH'] = "blah path" then i used the os.system method to invoke the java program and using ret = os.WEXITSTATUS(os.system(cmd)) to catch the return Java gave me an error about unable to l

Re: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?

2006-03-13 Thread Raymond Hettinger
[robert] > In very rare cases a program crashes (hard to reproduce) : > > * several threads work on an object tree with dict's etc. in it. Items > are added, deleted, iteration over .keys() ... ). The threads are "good" > in such terms, that this core data structure is changed only by atomic > oper

Re: Accessing overridden __builtin__s?

2006-03-13 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > I'm having a scoping problem. I have a module called SpecialFile, > which defines: > > def open(fname, mode): > return SpecialFile(fname, mode) > > class SpecialFile: > > def __init__(self, fname, mode): > self.f = open(fname, mode) > ... > [snip] > > Ho

Accessing overridden __builtin__s?

2006-03-13 Thread garyjefferson123
I'm having a scoping problem. I have a module called SpecialFile, which defines: def open(fname, mode): return SpecialFile(fname, mode) class SpecialFile: def __init__(self, fname, mode): self.f = open(fname, mode) ... The problem, if it isn't obvioius, is that the open() call in

Re: sizeof(struct timeval)

2006-03-13 Thread David Bolt
On Tue, 14 Mar 2006, Tony Houghton <[EMAIL PROTECTED]> wrote:- >In any case, it does imply that timeval can be relied on to be 2 * >32-bits (2 * long) in 32-bit architectures and something else in 64-bit >architectures - where long is 64-bit. Using the source below for a quick test on both a 32

markov query

2006-03-13 Thread kpp9c
markov query I have noticed a couple markov implementations in python, but none quite seem to do what i would like. Most seem to do an analysis of some text and create a new text based on that... I think, (sorry i just don't know terminology well) a markov table (or is it called a transition table

how to get all users that currently logged in?

2006-03-13 Thread iclinux
we can do it with 'who' in *nuix, but os.getlogin() returns only the user of the current process... how to do it by python, any suggestions? Best Regards. -- http://mail.python.org/mailman/listinfo/python-list

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-13 Thread Alex Martelli
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, robert wrote: > > > * Ruby without refcounts provides no deterministic __del__ in > > non-circular refs ==> your type finally finally finally .close .close > > .close all the time > > Which is what you should type in

Re: New python.org website

2006-03-13 Thread robin
"Michael Tobis" <[EMAIL PROTECTED]> wrote: >While the new one is much better than the old website, the logo strikes >me as awful. I personally believe the new logo is miles better than the old one. Whether you see snakes or a plus-sign or a yin-yang, it has a nice harmonious look that still captu

Re: Global Threading Lock 2 - Re: "RuntimeError: dictionary changed size during iteration"..

2006-03-13 Thread Raymond Hettinger
[robert] > That queue/passing-through-only-an-extra-global-var communication is > acceptable for thin thread interaction. > ( hope this extra global var is thread-safe in future Python's :-) ) > > But "real" thread-programming should also be possible in Python - and it > is with the usual disciplin

Re: sizeof(struct timeval)

2006-03-13 Thread Tony Houghton
In <[EMAIL PROTECTED]>, Big and Blue <[EMAIL PROTECTED]> wrote: > Big and Blue wrote: > > Tony Houghton wrote: > >> > >> How safe would I be assuming that > >> sizeof(struct timeval) == 2 * sizeof(long) > >> > >> is always true on Linux on different architectures? > > > >Based on what I wa

Re: sizeof(struct timeval)

2006-03-13 Thread Tony Houghton
In <[EMAIL PROTECTED]>, Big and Blue <[EMAIL PROTECTED]> wrote: > Tony Houghton wrote: >> >> How safe would I be assuming that >> >> sizeof(struct timeval) == 2 * sizeof(long) >> >> is always true on Linux on different architectures? > > Based on what I was looking at today (well, yes

python question about classes

2006-03-13 Thread diffuser78
I have following two classes Code: ## file_A.py class A(object): ## a contains is instances of A a= [ ] def __init__(self, node): self.nodes_in_A = [] self.nodes_in_A.append(node) packet_queue = [ ] ...etc ## file_B.py import A class B(object): ## n contains instances of B

Re: Very, Very Green Python User

2006-03-13 Thread Terry Hancock
On 12 Mar 2006 17:58:43 -0800 [EMAIL PROTECTED] wrote: > Double-underscore methods are rewritten with the class > name? That's an ugly hack, but remember I'm coming from > Perl. If the language doesn't pull many other hijinks, > that's OK. This is GvR's way of saying "do not use double-underscore

Re: PEP 8 example of 'Function and method arguments'

2006-03-13 Thread Terry Hancock
On Mon, 13 Mar 2006 17:18:16 +0100 "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > While I was reading PEP 8 I came across this part: > > """ > Function and method arguments > Always use 'self' for the first argument to instance > methods. Always use 'cls' for the first argument to >

Re: sizeof(struct timeval)

2006-03-13 Thread Big and Blue
Big and Blue wrote: > Tony Houghton wrote: >> >> How safe would I be assuming that >> sizeof(struct timeval) == 2 * sizeof(long) >> >> is always true on Linux on different architectures? > >Based on what I was looking at today (well, yesterday now), you might > be wrong. Howev

Re: sizeof(struct timeval)

2006-03-13 Thread Big and Blue
Tony Houghton wrote: > > How safe would I be assuming that > > sizeof(struct timeval) == 2 * sizeof(long) > > is always true on Linux on different architectures? Based on what I was looking at today (well, yesterday now), you might be wrong. I do know that the size of a struct u

Re: Q's: pythonD and range(1,12)

2006-03-13 Thread Raymond Hettinger
John Savage wrote: > Could > someone please explain the rationale behind python designers' thinking > in deciding the function "range(1,12)" should return the sequence 1 to > 11 rather than the more intuitively-useful 1 to 12?? There are several ways to do this, closed intervals, half-open interva

Is xml.dom.minidom.Element.cloneNode(deep=True) really fixed already?

2006-03-13 Thread Sullivan WxPyQtKinter
Hi, I am now using minidom for my current development. I use cloneNode method in Element object, but it just does not work. The test code is very simple as follows: =CODE== from xml.dom.minidom import * a=Element('see') print a.toprettyxml() b=a.cloneNode(True) print b.toprett

sizeof(struct timeval)

2006-03-13 Thread Tony Houghton
I'm writing a python program which reads input device events so it needs to know sizeof(struct timeval). By using the struct module I should be able to work out sizeof(long) from python, but I can't think of a way to measure non-fundamental types without including a little bit of C, which I'd rathe

Re: Help Create Good Data Model

2006-03-13 Thread mwt
fumanchu wrote: > If you used a Queue, it wouldn't be the container itself; rather, it > would be a gatekeeper between the container and consumer code. A > minimal example of user-side code would be: > > class Request: > def __init__(self, op, data): > self.op = op > self.data

Re: global namescape of multilevel hierarchy

2006-03-13 Thread Ben Cartwright
Sakcee wrote: > now in package.module.checkID function, i wnat to know what is the ID > defiend in the calling scriipt It's almost always a really bad idea to kludge scopes like this. If you need to access a variable from the caller's scope in a module function, make it an argument to that functi

Re: Q's: pythonD and range(1,12)

2006-03-13 Thread Tim Leslie
On 3/14/06, John Savage <[EMAIL PROTECTED]> wrote: I've very new to python, and am currently toying with pythonD. Couldsomeone please explain the rationale behind python designers' thinkingin deciding the function "range(1,12)" should return the sequence 1 to 11 rather than the more intuitively-use

Re: Cross Module Command Useage

2006-03-13 Thread Terry Hancock
On Sun, 12 Mar 2006 21:50:32 +0800 "Keith" <[EMAIL PROTECTED]> wrote: > So lets say have two modules.. moduleA and moduleB. they > are both imported into a main python program using the > "from module import *" command. now moduleA has a dynamic > command that needs to access a command that is in m

Re: Q's: pythonD and range(1,12)

2006-03-13 Thread Scott David Daniels
John Savage wrote: > Could someone please explain the rationale behind python designers' thinking > in deciding the function "range(1,12)" should return the sequence 1 to > 11 rather than the more intuitively-useful 1 to 12?? Essentially, it has to do with the decision to have range(5) mean the lis

global namescape of multilevel hierarchy

2006-03-13 Thread Sakcee
Hi I have a script e.g. import package.module ID = "55" package.module.checkID() now in package.module.checkID function, i wnat to know what is the ID defiend in the calling scriipt if I dot globals(), it returns only items in module. is there a way to get the script level namesapce th

Re: anonymous memory mapping

2006-03-13 Thread Peter Hansen
Fabiano Sidler wrote: > 2006/3/12, Fabiano Sidler <[EMAIL PROTECTED]>: > >>Is there any way to use anonymous memory mapping in python, versions >>earlier than 2.5? > > No idea or no way to do it? Often when there's no reply for a while, it's because the question is unclear. Rather than just ap

Q's: pythonD and range(1,12)

2006-03-13 Thread John Savage
I've very new to python, and am currently toying with pythonD. Could someone please explain the rationale behind python designers' thinking in deciding the function "range(1,12)" should return the sequence 1 to 11 rather than the more intuitively-useful 1 to 12?? After downloading the substantial

Re: time series calculation in list comprehension?

2006-03-13 Thread falcon
Wow, thanks for all the reponses. Very helpful! -- http://mail.python.org/mailman/listinfo/python-list

Re: lighter weight options to Python's logging package?

2006-03-13 Thread Vinay Sajip
> Trent> Do you have any profile information for where in the logging > Trent> package the time is being spent? > > Looking back at a recent run from a few days ago Formatter.formatTime() > seems to be a current problem. As Kent suggested, don't use %(asctime)s if you don't want fancy time for

Re: Localized month names?

2006-03-13 Thread Benji York
Jarek Zgoda wrote: > How do I get a list of localized month names for current locale? The > first thing that came to my mind was an ugly hack: >>> import locale >>> locale.nl_langinfo(locale.MON_1) 'January' -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to find repeated substrings with regular expression

2006-03-13 Thread johnzenger
Robert Dodier wrote: > I've decided it's easier for me just to search for FOO, and then > break up the string based on the locations of FOO. > > But I'd like to better understand regular expressions. Those who cannot learn regular expressions are doomed to repeat string searches. Which is not su

Build issue on AIX 5.3 with python 2.4.2

2006-03-13 Thread ktelep
I'm trying to build python 2.4.2 on AIX 5.3 with the IBM xlC compiler as per the notes in the AIX Readme file. Basically my make fails with the errors listed below. I'm calling configure with: ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable-ipv6 AR="ar -X64" It looks like

Re: Localized month names?

2006-03-13 Thread Fredrik Lundh
Jarek Zgoda wrote: > How do I get a list of localized month names for current locale? The > first thing that came to my mind was an ugly hack: > > import datetime > for i in range(12): > # as I remember, all months in 2005 had 1st in days > datetime.date(2005, i + 1, 1).strftime('%B') doe

Re: Python IDE: great headache....

2006-03-13 Thread Dag Fjeld Edvardsen
> What features exactly does it not have? Come to think of it, the only exception is probably that PyScripter (AFAIK) does not provide conditional pause. But I really like it. PyScripter is written in Delphi, my other favorite language :) -Dag -- http://mail.python.org/mailman/listinfo/pytho

Re: Is this possible in Python?

2006-03-13 Thread Grant Edwards
On 2006-03-13, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello again, > I am disappointed. Yea, life's like that. Sucks, eh? -- Grant Edwards grante Yow! ... The waitress's at UNIFORM sheds TARTAR SAUCE

Re: Python Love :)

2006-03-13 Thread http://phr.cx
"gregarican" <[EMAIL PROTECTED]> writes: > reversed(a_string) (python) > > Which version of Python offers this function? It doesn't seem to be > available in the 2.3 version I have installed... > I think it's new in 2.4. -- http://mail.python.org/mailman/listinfo/python-list

Localized month names?

2006-03-13 Thread Jarek Zgoda
How do I get a list of localized month names for current locale? The first thing that came to my mind was an ugly hack: import datetime for i in range(12): # as I remember, all months in 2005 had 1st in days datetime.date(2005, i + 1, 1).strftime('%B') but I am sure there is a better way.

Re: Anomalous behaviour when compiling regular expressions?

2006-03-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I agree to a certain extent, but by analogy > > > ]> > > > is a valid SGML/XML document and their is a lot of (superficial?) > similarity between DTD content models and REs. they're related, but they don't have the same semantics (Python uses a backtracking engine, w

Re: Is this possible in Python?

2006-03-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I don't want a better way, i just want a solution to the problem as > described! any special reason you cannot use Python to write Python programs, instead of demanding that someone else wastes time inventing a non- portable solution to a braindead problem? what's wron

Re: list/classmethod problems

2006-03-13 Thread ahart
Diez, Scott, and Bruno, I thank you all for your help and suggestions. I wasn't aware that default values were considered class (static) values. That seems a little odd to me, but as long as I know that's the case, I'll be fine. I initialized my list member in the __init__() method and all is wor

Re: "RuntimeError: dictionary changed ... & Ruby

2006-03-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, robert wrote: > * Ruby without refcounts provides no deterministic __del__ in > non-circular refs ==> your type finally finally finally .close .close > .close all the time Which is what you should type in Python too as there's no guarantee that `__del__()` will be calle

Re: Is this possible in Python?

2006-03-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I don't want a better way, i just want a solution to the problem as > described! I once did something like: try: raise ValueError except ValueError, e: pass then get the traceback object out of e, and snarf the relevant source line as mentioned before. --

Re: Is this possible in Python?

2006-03-13 Thread alainpoint
Hi Kent, My intention is to be able to retrieve any line of code in a running program, in the following way: def magic_funct(s): for line in file(s.gi_frame.f_code.co_filename): print line magic_funct(i for i in [1,2,3]) I just find it stupid to be obliged to use a generato

Re: Is this possible in Python?

2006-03-13 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hello again, > I am disappointed. You are the experts, you've got to try harder ;-) > What i want is a generalisation of this tiny function: Why? Maybe we can find a better way... Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: list/classmethod problems

2006-03-13 Thread Bruno Desthuilliers
ahart a écrit : > I'm pretty new to python and am trying to write a fairly small > application to learn more about the language. I'm noticing some > unexpected behavior in using lists in some classes to hold child > objects. Here is some abbreviated code to help me explain. > > ###

Re: Please, I Have A Question before I get started

2006-03-13 Thread paron
Well, there's OpenLaszlo, which handles the sounds/animation for http:www.pandora.com, I understand. It may be overkill for a desktop app, but it's free. It was originally written in Python, I think, but it uses ECMAScript for scripting. It's free, and reportedly handles sounds and animations, and

Re: Why property works only for objects?

2006-03-13 Thread John J. Lee
Michal Kwiatkowski <[EMAIL PROTECTED]> writes: [...] > "Return a property attribute for new-style classes". After reading a bit > about descriptors I've just assumed that property is a handy way to > create (any) descriptors. Learning that it only creates overriding > descriptors was a bit shocking

Re: list/classmethod problems

2006-03-13 Thread Scott David Daniels
ahart wrote: > I'm pretty new to python and am trying to write a fairly small > application to learn more about the language. I'm noticing some > unexpected behavior in using lists in some classes to hold child > objects. Here is some abbreviated code to help me explain. > > When I run this script

Re: Is this possible in Python?

2006-03-13 Thread alainpoint
Hello again, I am disappointed. You are the experts, you've got to try harder ;-) What i want is a generalisation of this tiny function: import tokenize import token def magic_function(s): readline = open(s.gi_frame.f_code.co_filename).readline for t in tokenize.generate_tokens(open

Re: anonymous memory mapping

2006-03-13 Thread Fabiano Sidler
2006/3/12, Fabiano Sidler <[EMAIL PROTECTED]>: > Is there any way to use anonymous memory mapping in python, versions > earlier than 2.5? No idea or no way to do it? Greetings, F. Sidler -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter / Mac OS X Question (Aqua vs. X11)

2006-03-13 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > I am running Mac OS X. I have Tcl/Tk installed. I can run the Aqua > version (TkAqua) of wish by typing 'wish' at a terminal prompt. I can > run the X11 version (TkX11) of wish by typing 'wish8.4-X11' in an > x-term. If I run python and import Tkinter it always grabs

Re: list/classmethod problems

2006-03-13 Thread Diez B. Roggisch
> > Apparently, the p1 instance somehow thinks that the i3 instance is in > its list. The i3 instance should instead be in the list for p2. By the > way, when I call the __str__() method of p2, I get the same results as > when I do it for p1. The list appears to be acting as if it were a > static

Re: Is it better to use class variables or pass parameters?

2006-03-13 Thread Derek Basch
Wow! Thanks everyone. Such coherent and philisophical answers. I will read them all over on a lazy sunday as this type ethereal stuff hurts my head after about 30 seconds. All the gurus on the python list are so friggin' smart. This should improve my coding after I digest it all. Thanks Again! Der

Re: Python Love :)

2006-03-13 Thread Paddy
BWill wrote: > and ixnay on the ubyray or else I'll tell you where to stick your > endblock delimiter :P Umm, Did you mean to write the above? What has it to do with Ruby? -- http://mail.python.org/mailman/listinfo/python-list

list/classmethod problems

2006-03-13 Thread ahart
I'm pretty new to python and am trying to write a fairly small application to learn more about the language. I'm noticing some unexpected behavior in using lists in some classes to hold child objects. Here is some abbreviated code to help me explain. class Item

Re: Very, Very Green Python User

2006-03-13 Thread Lonnie Princehouse
> Python closures are apparently very poor, but from what I can surmise > of the PyGTK2 page, instances of objects are dynamic enough to add new > methods, so you get your callbacks, at least. It's true that Python's "lambda" is somewhat limited, but this is rarely a problem because you can define

Re: Which GUI toolkit is THE best?

2006-03-13 Thread ahart
i'm pretty much a newbie, too, and have been dabbling with some gui tools so far, i like pythoncard pretty well it wraps wxpython and seems to be pretty easy to use -- http://mail.python.org/mailman/listinfo/python-list

Re: Which GUI toolkit is THE best?

2006-03-13 Thread Paul Boddie
Paul Rubin wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > > What people don't usually understand (or rather complain about loudly) > > is that Trolltech can refuse to license Qt to you under the commercial > > licence, as is their right as the owner of the copyrighted work. > > What is the de

Re: Python Love :)

2006-03-13 Thread gregarican
Paul Rubin wrote: > Darn, yes, that's the second time in the past couple weeks I've made > that exact same error in a clpy post. So what's the most concise way > of turning it back into a string? ''.join(list(reversed(a_string))) ? > Bleccch. Use Ruby: print "A String".reverse Just kidding :

Re: Please, I Have A Question before I get started

2006-03-13 Thread paron
Since you are comfortable with HTML, you could use the browser as your GUI, and use a lightweight python server like Karrigell (or CherryPy, or Turbogears) to serve the pages. A little javascript to move the highlighting around, and . . . Well, frankly, it's still harder than it ought to be. (I ag

Re: No more then 1 Instance of Application..

2006-03-13 Thread Grant Edwards
On 2006-03-13, Math <[EMAIL PROTECTED]> wrote: > Does anybody know what I have to do to run only 1 instance of > my Python Application? Yes. http://www.google.com/search?hl=en&q=python+single+application+instance On Unix, one creates a lock file. Typically /var/run/.pid if you want a single sy

Re: trying to find repeated substrings with regular expression

2006-03-13 Thread Giovanni Bajo
Robert Dodier wrote: > Hello all, > > I'm trying to find substrings that look like 'FOO blah blah blah' > in a string. For example give 'blah FOO blah1a blah1b FOO blah2 > FOO blah3a blah3b blah3b' I want to get three substrings, > 'FOO blah1a blah1b', 'FOO blah2', and 'FOO blah3a blah3b blah3b'.

Re: Python Love :)

2006-03-13 Thread Kent Johnson
Paul Rubin wrote: > So what's the most concise way > of turning it back into a string? ''.join(list(reversed(a_string))) ? You don't need the list(), join() can take an iterator: ''.join(reversed(a_string)) Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest-alike for a unix shell?

2006-03-13 Thread JW
1. Try os.popen: >>> import os >>> os.popen('echo Hello World').read() 'Hello World\n' 2. Try a test environment built for testing shell commands, such as DejaGnu: http://www.gnu.org/software/dejagnu/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter / Mac OS X Question (Aqua vs. X11)

2006-03-13 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: >> Install python using fink, and invoke that. Should work against X11 for >> all GUI-Toolkits. > > I prefer not to do this. Darwin is already a Unix, and Apple provides > a version of X11 that works well with it. > Fink seems like an > unecessary layer that I would r

Re: Global Threading Lock 2 - Re: "RuntimeError: dictionary changedsize during iteration"..

2006-03-13 Thread Terry Reedy
"robert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Though mostly ignorant of threading issues, I wonder if the following would work. Derive a class from dict. Define a backup method that sets and unsets a private self.lock. Define setitem and delitem methods that wrap cal

Re: PEP 8 example of 'Function and method arguments'

2006-03-13 Thread bruno at modulix
Martin P. Hellwig wrote: > While I was reading PEP 8 I came across this part: > > """ > Function and method arguments >Always use 'self' for the first argument to instance methods. >Always use 'cls' for the first argument to class methods. > """ > > Now I'm rather new to programming and u

Re: Python IDE: great headache....

2006-03-13 Thread Caleb Hattingh
Hi Being a Delphi user at work, I know what you mean :) The best python IDE I have found is Stani's Python Editor (SPE), and I think Stani himself replied to your message as well. It integrates wxGlade, which is nice for form-building, although I don't really do much of that with the python co

Re: Python Love :)

2006-03-13 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > >>> print reversed("abba") > Darn, yes, that's the second time in the past couple weeks I've made that exact same error in a clpy post. So what's the most concise way of turning it back into a string? ''.join(list(reversed(a_string))) ? Bleccch. -- htt

Re: No more then 1 Instance of Application..

2006-03-13 Thread Christoph Haas
On Monday 13 March 2006 18:31, Math wrote: > Does anybody know what I have to do to run only 1 instance of my Python > Application? > How do I check if I'm running more instances of a Application? I would use lockfiles for that purpose. Like this: http://aspn.activestate.com/ASPN/Cookbook/Python/R

Re: trying to find repeated substrings with regular expression

2006-03-13 Thread Kent Johnson
Robert Dodier wrote: > Hello all, > > I'm trying to find substrings that look like 'FOO blah blah blah' > in a string. For example give 'blah FOO blah1a blah1b FOO blah2 > FOO blah3a blah3b blah3b' I want to get three substrings, > 'FOO blah1a blah1b', 'FOO blah2', and 'FOO blah3a blah3b blah3b'.

Re: Which GUI toolkit is THE best?

2006-03-13 Thread Chris Mellon
On 13 Mar 2006 10:19:05 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > > What people don't usually understand (or rather complain about loudly) > > is that Trolltech can refuse to license Qt to you under the commercial > > licence, as is thei

Re: Python Love :)

2006-03-13 Thread Peter Otten
Paul Rubin wrote: > "gregarican" <[EMAIL PROTECTED]> writes: >> > reversed(a_string) (python) >> >> Which version of Python offers this function? It doesn't seem to be >> available in the 2.3 version I have installed... > > I think it's new in 2.4. Needs a little help, though: >>> print re

No more then 1 Instance of Application..

2006-03-13 Thread Math
Hello, Pardon my English... Does anybody know what I have to do to run only 1 instance of my Python Application? How do I check if I'm running more instances of a Application? Thank you all -- http://mail.python.org/mailman/listinfo/python-list

Re: Please, I Have A Question before I get started

2006-03-13 Thread Kent Johnson
Ravi Teja wrote: > I do not think that technology has gone backwards. Hyper card > alternatives still exist. > http://www.metacard.com/ At $995 per seat it's not likely to be used for a home project. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: IOS-style command line interface module?

2006-03-13 Thread David Wilson
Doh, I am indeed referring to the standard "cmd" module - thanks! To [EMAIL PROTECTED], the above module does what you describe. Thanks again, David. -- http://mail.python.org/mailman/listinfo/python-list

Re: Please, I Have A Question before I get started

2006-03-13 Thread JW
Skipper wrote: > I can not believe that there isn't a GUI programing tool that will > allow me to build GUI apps - just like I use Dreamweaver to build a > web page ... a WYSIWYG builder that does a few simplet things and > calls other programs ... > > Oh well no silver bullet! If you are int

Re: suse linux 10 and wx.listctrl display issues

2006-03-13 Thread ianaré
Well that definitly works, thanks. Is there any way to keep the themes though? -- http://mail.python.org/mailman/listinfo/python-list

Re: Which GUI toolkit is THE best?

2006-03-13 Thread Paul Rubin
"Paul Boddie" <[EMAIL PROTECTED]> writes: > What people don't usually understand (or rather complain about loudly) > is that Trolltech can refuse to license Qt to you under the commercial > licence, as is their right as the owner of the copyrighted work. What is the deal here? Why would they refu

Re: Is this possible in Python?

2006-03-13 Thread Caleb Hattingh
Hi I don't think this is what you want (a string representation of the argument passed to a function as that argument is at runtime is way beyond my abilities), but this can retrieve the literal text in the function call as it appears in the .py file, assuming you have the .py file available a

Re: Is this possible in Python?

2006-03-13 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > I wonder if Python is capable of the following: define a function which > returns its argument. > I mean: > def magic_function(arg): >.. some magic code ... > > that behaves the following way: > > assert magic_functi

Re: Which GUI toolkit is THE best?

2006-03-13 Thread Paul Boddie
Thomas Guettler wrote: > > Have you read all the text? > > """ > Two qualities of the Qt Commercial License should be emphasized: > > You need it before you start development of proprietary software. > > You must purchase a Qt Commercial License from Trolltech or from any of > its authorized resell

Re: Environmental Variables

2006-03-13 Thread Diez B. Roggisch
Dennis Lee Bieber wrote: > The Amiga did have a means for such... It differentiated between > local and global environment variables. Locals were kept in a process > memory structure and behaved as they do on most other OSs... Globals, > however, were short files maintained in ENV: (a logical name

Re: Python Love :)

2006-03-13 Thread Paul Rubin
"gregarican" <[EMAIL PROTECTED]> writes: > > reversed(a_string) (python) > > Which version of Python offers this function? It doesn't seem to be > available in the 2.3 version I have installed... I think it's new in 2.4. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Love :)

2006-03-13 Thread gregarican
Paul Rubin wrote: > reversed(a_string) (python) Which version of Python offers this function? It doesn't seem to be available in the 2.3 version I have installed... -- http://mail.python.org/mailman/listinfo/python-list

trying to find repeated substrings with regular expression

2006-03-13 Thread Robert Dodier
Hello all, I'm trying to find substrings that look like 'FOO blah blah blah' in a string. For example give 'blah FOO blah1a blah1b FOO blah2 FOO blah3a blah3b blah3b' I want to get three substrings, 'FOO blah1a blah1b', 'FOO blah2', and 'FOO blah3a blah3b blah3b'. I've tried numerous variations o

Re: Python Love :)

2006-03-13 Thread Paul Rubin
rtilley <[EMAIL PROTECTED]> writes: > a_string.reverse (ruby) > a_string[::-1](python) reversed(a_string) (python) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this possible in Python?

2006-03-13 Thread Ron Garret
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Hi > > I wonder if Python is capable of the following: define a function which > returns its argument. > I mean: > def magic_function(arg): > .. some magic code ... > > that behaves the following way: > > assert magic_funct

Re: Is this possible in Python?

2006-03-13 Thread alainpoint
Kay Schluehr wrote: > Storing arguments away before they are evaluated doesn't work in > Python. You have to hack the compiler in order to access the parsetree. > You might take a look at the compiler package of the standard library > that enables access to ASTs. Thus you could define lazy evaluat

Re: Python Love :)

2006-03-13 Thread rtilley
BWill wrote: > and ixnay on the ubyray or else I'll tell you where to stick your > endblock delimiter :P OK, I can't help it... which is more readable: a_string.reverse(ruby) a_string[::-1] (python) -- http://mail.python.org/mailman/listinfo/python-list

Re: IOS-style command line interface module?

2006-03-13 Thread hugonz
Hell, this sounds interesting. Do you mean like matching commands when they are not yet complete, like sh tech instead of: show tech-support ? -- http://mail.python.org/mailman/listinfo/python-list

Announcing edupython list

2006-03-13 Thread Anna Ravenscroft
In order to facilitate small groups working on specific Python-in-Education projects, we have launched an edupython list on google groups(http://groups.google.com/group/edupython or [EMAIL PROTECTED]). We envision participation by people trying to coordinate work on the nuts and bolts implementati

  1   2   >