Re: need some regular expression help

2006-10-08 Thread Diez B. Roggisch
hanumizzle wrote: > On 7 Oct 2006 15:00:29 -0700, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > > Chris wrote: > > > I need a pattern that matches a string that has the same number of '(' > > > as ')': > > > findall( compile('...'), '42^((2x+2)sin(x)) + (log(2)/log(5))' ) = [ > > > '((2x+2)si

Re: need some regular expression help

2006-10-08 Thread Theerasak Photha
On 8 Oct 2006 01:49:50 -0700, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Even if it has - I'm not sure if it really does you good, for several > reasons: > > - regexes - even enhanced ones - don't build trees. But that is what > you ultimately want >from an expression like sin(log(x)) > >

Re: A critique of cgi.escape

2006-10-08 Thread Duncan Booth
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > Another useful function is this: > > def JSString(Str) : > """returns a JavaScript string literal that evaluates to Str. > Note I'm not worrying about non-ASCII characters for now.""" Here is a shorter alternative that handles

Re: People's names (was Re: sqlite3 error)

2006-10-08 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steve > Holden wrote: > > >>John Machin wrote: >> >>[lots of explanation about peculiarities of people's names] >> >>While I don't dispute any of this erudite display of esoteric >>nomenclature wisdom the fact remains that many (predomi

Re: need some regular expression help

2006-10-08 Thread bearophileHUGS
Tim Chase: > It still doesn't solve the aforementioned problem > of things like ')))(((' which is balanced, but psychotic. :) This may solve the problem: def balanced(txt): d = {'(':1, ')':-1} tot = 0 for c in txt: tot += d.get(c, 0) if tot < 0: return Fal

Re: Access to static members from inside a method decorator?

2006-10-08 Thread glen . coates . bigworld
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > You define one base type with a custom metaclass and inherit from that. Your > example then becomes: > > import sys > > class ExposedType( type ): > def __init__( cls, *args, **kw ): > # Track marked exposed methods > cls.s_expos

Re: need some regular expression help

2006-10-08 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The dict solution looks better, but this may be faster: it's slightly faster, but both your alternatives are about 10x slower than a straightforward: def balanced(txt): return txt.count("(") == txt.count(")") -- http://mail.python.org/mailman/listinfo/python

Re: People's names (was Re: sqlite3 error)

2006-10-08 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > There would also need to be a flag field to indicate the canonical > > ordering > > for writing out the full name: e.g. family-name-first, given-names-first. > > Do we need something else for the Vietnamese case? > > You'd think some standards body woul

A curses-game I need help with.

2006-10-08 Thread Gasten
Hello. The last weeks I've been coding a roguelike (you know, like nethack) in python using the nCurses library. Some week ago I ran into a problem: When I made the object for messagebar-output, I found a bug that I can't figure out (believe me; I've tried everything and asked for help several time

Implementing a circular counter using property / descriptors?

2006-10-08 Thread IloChab
I'd like to implement an object that represents a circular counter, i.e. an integer that returns to zero when it goes over it's maxVal. This counter has a particular behavior in comparison: if I compare two of them an they differ less than half of maxVal I want that, for example, 0 > maxVal gives

Re: error handling in user input: is this natural or just laborious

2006-10-08 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, James Stroud > wrote: > > >>Patently. Tabs should be reserved for tables, for which tabs were named. >>If they were meant to be used for indenting, they would have been >>named "indenters". > Or possibly "inds", in a similarly abbrevi

Re: operator overloading + - / * = etc...

2006-10-08 Thread Steve Holden
Tim Chase wrote: >>>Can these operators be overloaded? >> >>Yes. > > > With the caveat of the "=" mentioned in the subject-line (being > different from "==")...I haven't found any way to override > assignment in the general case. There might be some oddball way > to do it via property() but A

Re: Can't get around "IndexError: list index out of range"

2006-10-08 Thread Steven D'Aprano
On Sat, 07 Oct 2006 18:06:47 -0700, MonkeeSage wrote: > On Oct 7, 7:59 pm, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> Because they aren't needed often, and when they are, they are easy to >> implement? > > More often and easier to implement than dict.has_key / get? No, *less* often. That's

Re: Implementing a circular counter using property / descriptors?

2006-10-08 Thread Steven D'Aprano
On Sun, 08 Oct 2006 12:25:10 +0200, IloChab wrote: > I'd like to implement an object that represents a circular counter, i.e. > an integer that returns to zero when it goes over it's maxVal. [snip] > The python problem that I give you it's about style. > I'd like to write in my code something t

Re: dictionary containing a list

2006-10-08 Thread Ben
I think what you mean is that if you change your list, it is changed somewhere in your dicrionary to. Lists are always copied as pointers, except explicitly told other wise. So a = b = [] makes a and be the same list, and a.append(1) makes b -> [1]. So do something like mydict[mykey] = mylist[:] (

Bizzare lst length problem

2006-10-08 Thread Ben
Hello...hopefully my last question :-) I ave a dictionary, where each value is a class instance. I access it using: for k, v in self.panels.panel_list.items(): print "Number:\t",v.number print "Level:\t",v.level print "Location:\t",v.location

Re: Bizzare lst length problem

2006-10-08 Thread Fredrik Lundh
Ben wrote: > The output from this would be (for a given key value): > Number: 181 > Level:ovride+supvis > Location: mons=4 v8.0 3rd floor > MOPS: ['287', '288', '289', '290'] > List Length: 28 >

sign in

2006-10-08 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** confirm 48f0beb37c698f0bb7b4c0327cf30dbd7a4b6335 -- http://mail.python.org/mailman/listinfo/python-list

Re: Scientific computing and data visualization.

2006-10-08 Thread [EMAIL PROTECTED]
> > I can definitively second that. ROOT is a bit hard to learn but very, > > very powerful and PyRoot is really a pleasure to work with. > > It sounds interesting. Right now, I use matplotlib for > 2D plotting and vtk for 3D. Do you have any experience and > can give some recommendations? Hi Fabi

wxpython problems using GLCanvas

2006-10-08 Thread nelson
Hi, i'm coding a 3d interactive geometry progam and i want to use opengl for displaying ogbjects. I can open a opengl canvas (i follow the wxpython demo) and i can draw a cube. First time i execute the application all is ok. second time it freezes X and i can't interact with my machine. I hava on

Re: need some regular expression help

2006-10-08 Thread Mirco Wahab
Thus spoke Diez B. Roggisch (on 2006-10-08 10:49): > Certainly true, and it always gives me a hard time because I don't know > to which extend a regular expression nowadays might do the job because > of these extensions. It was so much easier back in the old times Right, in perl, this would be

Re: Names changed to protect the guilty

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, John Machin wrote: > > Steven D'Aprano wrote: >> On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote: >> >> > >> > MonkeeSage wrote: >> >> On Oct 6, 8:02 pm, "MonkeeSage" <[EMAIL PROTECTED]> wrote: >> >> > it is clearer to you to make the condition explicit ("bla

Re: Kde Taskbar

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, David Boddie wrote: > I'd be interested in an example of how to use knotify via DCOP. Found a tutorial here . -- http://mail.python.org/mailman/listinfo/python-list

Re: need some regular expression help

2006-10-08 Thread Diez B. Roggisch
Mirco Wahab schrieb: > Thus spoke Diez B. Roggisch (on 2006-10-08 10:49): >> Certainly true, and it always gives me a hard time because I don't know >> to which extend a regular expression nowadays might do the job because >> of these extensions. It was so much easier back in the old times > >

Re: Newbie - Stuck

2006-10-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > The perl version of this code works but not the python version. What am > I doing wrong? > > message = "abc" > password = "z12" > > scrambled = message ^ password > > I also wondered why this errored as well... > > int(messege) > > Is it not meant to convert a stri

Re: need some regular expression help

2006-10-08 Thread bearophileHUGS
Fredrik Lundh wrote: > it's slightly faster, but both your alternatives are about 10x slower > than a straightforward: > def balanced(txt): > return txt.count("(") == txt.count(")") I know, but if you read my post again you see that I have shown those solutions to mark ")))(((" as bad expres

Re: Newbie - Stuck

2006-10-08 Thread bearophileHUGS
[EMAIL PROTECTED]: Python is strongly typed, and it converts types automatically less often than Perl. The purpose of such strong(er) typing is to allow to catch some kind of bugs, and to make the syntax simpler, more readable, etc. > message = "abc" > password = "z12" > scrambled = message ^ pas

Re: Names changed to protect the guilty

2006-10-08 Thread John Machin
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John > Machin wrote: > > > > > Steven D'Aprano wrote: > >> On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote: > >> > >> > > >> > MonkeeSage wrote: > >> >> On Oct 6, 8:02 pm, "MonkeeSage" <[EMAIL PROTECTED]> wrote: > >> >> > it is cle

Re: Painless way to do 3D visualization

2006-10-08 Thread Peter Beattie
faulkner wrote: > http://www.vpython.org/ Oh, thanks, but let me quote myself: >> So far, I've only tinkered a little with VPython, but the lack >> of any decent documentation has proved to be a major turn-off. So, I'd really appreciate any hints as to where to look for anything a little more us

Re: Bizzare lst length problem

2006-10-08 Thread Ben
Ah... my list is a string. That explains the len() results, but not why it is a string in the dirst place. I have a dictionary containing a number of instances of the following class as values: class panel: mops =[] def __init__(self,number,level,location,mops,matrix): self.numb

Re: Newbie - Stuck

2006-10-08 Thread Paddy
[EMAIL PROTECTED] wrote: > The perl version of this code works but not the python version. What am > I doing wrong? > > message = "abc" > password = "z12" > > scrambled = message ^ password > > I also wondered why this errored as well... > > int(messege) > > Is it not meant to convert a string to a

Re: Names changed to protect the guilty

2006-10-08 Thread John Machin
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John > Machin wrote: > > > > > Steven D'Aprano wrote: > >> On Fri, 06 Oct 2006 18:29:34 -0700, John Machin wrote: > >> > >> > > >> > MonkeeSage wrote: > >> >> On Oct 6, 8:02 pm, "MonkeeSage" <[EMAIL PROTECTED]> wrote: > >> >> > it is cle

Re: Bizzare lst length problem

2006-10-08 Thread Ben
...and when I print out the string, it is still formatted as one would expect a list to be: "['01', '02', '03', '04']" Ben wrote: > Ah... my list is a string. That explains the len() results, but not why > it is a string in the dirst place. > > I have a dictionary containing a number of instan

Re: Bizzare lst length problem

2006-10-08 Thread John Machin
Ben wrote: > Ah... my list is a string. That explains the len() results, but not why > it is a string in the dirst place. > > I have a dictionary containing a number of instances of the following > class as values: > > class panel: > mops =[] > > def __init__(self,number,level,location,mop

Re: Bizzare lst length problem

2006-10-08 Thread John Machin
Ben wrote: > Ah... my list is a string. That explains the len() results, but not why > it is a string in the dirst place. > > I have a dictionary containing a number of instances of the following > class as values: > > class panel: > mops =[] > > def __init__(self,number,level,location,mop

Re: Bizzare lst length problem

2006-10-08 Thread Ben
Thanks for the advice - I'm already doing just that, so hopefully will soon be sorted :-p John Machin wrote: > Ben wrote: > > Ah... my list is a string. That explains the len() results, but not why > > it is a string in the dirst place. > > > > I have a dictionary containing a number of instance

Re: Bizzare lst length problem

2006-10-08 Thread John Machin
Ben wrote: > ...and when I print out the string, it is still formatted as one would > expect a list to be: > > "['01', '02', '03', '04']" > We know that. Fredrik deduced it and told you well over an hour ago. Show us the code that is creating instances of the panel class ... panel1 = panel(num

Re: Bizzare lst length problem

2006-10-08 Thread Ben
Using Fredericks advice I managed to track down the problem - it was really very stupid. I had accidentally cast the list to a string earlier in another part of the code. Its a bit of an anticlimax really - not mysterious at all (just mysteriously remiss on my part) Apologies for not simple postin

Re: Bizzare lst length problem

2006-10-08 Thread Theerasak Photha
On 8 Oct 2006 06:12:48 -0700, John Machin <[EMAIL PROTECTED]> wrote: > > Show us the code that is creating instances of the panel class ... > > panel1 = > panel(number=?,level=?,location=?,mops=,matrix=?) > What are you passing as the 4th positional arg > ^^^ ??

Re: Bizzare lst length problem

2006-10-08 Thread John Machin
Theerasak Photha wrote: > On 8 Oct 2006 06:12:48 -0700, John Machin <[EMAIL PROTECTED]> wrote: > > > > > Show us the code that is creating instances of the panel class ... > > > > panel1 = > > panel(number=?,level=?,location=?,mops=,matrix=?) > > What are you passing as the 4th pos

Re: Bizzare lst length problem

2006-10-08 Thread Ben
Ah - I found out why I had cast it to a string. I had not, at that point, worked out ho to pass the list by value rather than reference, and so was casting to a string as a stopgap measure that I then forgot about. Now the problem is fixed after this group told me how to pass a list by value (by sl

Re: need some regular expression help

2006-10-08 Thread Roy Smith
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Certainly true, and it always gives me a hard time because I don't know > to which extend a regular expression nowadays might do the job because > of these extensions. It was so much easier back in the old times What old times? I've been working

Re: need some regular expression help

2006-10-08 Thread Theerasak Photha
On 10/8/06, Roy Smith <[EMAIL PROTECTED]> wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Certainly true, and it always gives me a hard time because I don't know > > to which extend a regular expression nowadays might do the job because > > of these extensions. It was so much easier back

Re: Bizzare lst length problem

2006-10-08 Thread Fredrik Lundh
Ben wrote: > Ah - I found out why I had cast it to a string. I had not, at that > point, worked out ho to pass the list by value rather than reference, > and so was casting to a string as a stopgap measure that I then forgot > about. Now the problem is fixed after this group told me how to pass a

Re: Bizzare lst length problem

2006-10-08 Thread John Machin
Ben wrote: > Ah - I found out why I had cast it to a string. I had not, at that > point, worked out ho to pass the list by value rather than reference, > and so was casting to a string as a stopgap measure that I then forgot > about. Now the problem is fixed after this group told me how to pass a

Re: Kde Taskbar

2006-10-08 Thread David Boddie
On Sunday 08 October 2006 14:16, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, David Boddie > wrote: > >> I'd be interested in an example of how to use knotify via DCOP. > > Found a tutorial here . Thanks for the link. Maybe the original

Re: Encoding and norwegian (non ASCII) characters.

2006-10-08 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > > I am having great problems writing norwegian characters æøå to file > from a python application. My (simplified) scenario is as follows: > > 1. I have a web form where the user can enter his name. > > 2. I use the cgi module module to get to the input from the user: >

missing has_column_major_storage

2006-10-08 Thread Dave
hello I have intalled the Enthought Edition 1.0.0, when i successed use f2py compile my fortran file to python module. But when I call "has_column_major_storage function" in the extended module. it's cannot find. "has_column_major_storage function" function have been remove from numpy/f2py ?? ho

Re: Python to use a non open source bug tracker?

2006-10-08 Thread Ilias Lazaridis
Ben Finney wrote: > "Ilias Lazaridis" <[EMAIL PROTECTED]> writes: > > > As for Mr. Holden... it's not a matter of not respecting you. > > It is in his nature to babble in this way. > > Sometimes it's even funny! > > Oh my. You have *seriously* misjudged this group if you think that > comment will g

Re: operator overloading + - / * = etc...

2006-10-08 Thread SpreadTooThin
Daniel Nogradi wrote: > > Can these operators be overloaded? > > If so. How? > > > > http://www.python.org/doc/ref/numeric-types.html > > HTH, > Daniel Thanks everyone. -- http://mail.python.org/mailman/listinfo/python-list

Re: Painless way to do 3D visualization

2006-10-08 Thread Ron Adam
Peter Beattie wrote: > Hey folks, > > I need to do the following relatively simple 3D programming: > > I want to convert data from four-item tuples into 3D co-ordinates in a > regular tetrahedron. Co-ordinates come in sequences of 10 to 20, and the > individual dots in the tetrahedron need to be

SqlAlchemy how and where it can be used?

2006-10-08 Thread tomec
hello, Ive read some articles about SqlAlchemy but i don't know where i can use this? Lets say that i would like to create some application which will be using sqlAlchemy My question is which programming language can i code to use it? (only Python)? Do you know any good python editors which suppor

Re: missing has_column_major_storage

2006-10-08 Thread Robert Kern
Dave wrote: > hello >I have intalled the Enthought Edition 1.0.0, when i successed use > f2py compile my fortran file to python module. But when I call > "has_column_major_storage function" in the extended module. it's cannot > find. "has_column_major_storage function" function have been remove

recommendations for personal journaling application

2006-10-08 Thread Donnie Rhodes
Hi. I've been sort of standing back on the sidelines reading this list for awhile, and this is my first posting. So a little about myself and my skill level. My name is Bryan. I'm new to Python and have very little experience. I've gone through a few of the tutorials. I understand the different dat

Re: A critique of cgi.escape

2006-10-08 Thread Scott David Daniels
Lawrence D'Oliveiro wrote: > Another useful function is this: > > def JSString(Str) : > """returns a JavaScript string literal that evaluates to Str You can do this more simply: _map = {"\\" : "", "\"" : "\\\"", "\t" : "\\t", "\n" : "\\n"} def JSString(Str) :

ANN: ChiPy Thurs. October 12, 2006. 7pm @ Performics 180 N. Lasalle

2006-10-08 Thread Chris McAvoy
Join us for our best meeting ever! Thurs. October 12th, 2006. 7pm. Topics - * PLY (Python Lex Yacc) David Beazley * Performance Python (without PyPy) Michael Tobis Location Performics 180 N. Lasalle 12th floor. Chicago RSVP (for building security) by Tuesday night to [EMAIL

Re: Can't get around "IndexError: list index out of range"

2006-10-08 Thread MonkeeSage
On Oct 8, 5:57 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > No, *less* often. That's the point -- it is fairly common for people to > want dictionary lookup to return a default value, but quite rare for them > to want sequence lookup to return a default value. A sequence with a > default value

references and buffer()

2006-10-08 Thread km
Hi all, was looking at references  in python... >>> a = 10 >>> b = a  >>> id(a) 153918788 >>>id(b) 153918788 where a and b point to the same id. now is this id an address ? can one dereference a value based on address alone in python? is id similar to the address of a variable or a class ? re

Re: Can't get around "IndexError: list index out of range"

2006-10-08 Thread Fredrik Lundh
MonkeeSage wrote: > With list.has_index() / get(), the following (pretty common I think) > idiom: > > try: > data = some_unknown_seq[2] > except IndexError: > data = None > if data: ... umm. you could at least write: try: data = some_unknown_seq[2] except IndexError:

print time comparison: IDLE versus terminal on ultra 20

2006-10-08 Thread sam
hi all, i continue to footle around on my spanking new ultra 20 (1.8GHz / Opteron Model 144), gradually trying to get to grips with python and unix both. the slow print time in IDLE had already struck me as rather odd. running programs with heavy print requirements from the terminal was a major d

Re: references and buffer()

2006-10-08 Thread Fredrik Lundh
km wrote: > > Hi all, > > was looking at references in python... > >>> a = 10 > >>> b = a > >>> id(a) > 153918788 > >>>id(b) > 153918788 > > where a and b point to the same id. now is this id an address ? no, it's the object identity, and all it tells you is that both names point to the s

Re: print time comparison: IDLE versus terminal on ultra 20

2006-10-08 Thread Fredrik Lundh
sam wrote: > in IDLE: > 4.433 seconds IDLE is designed for tinkering, not fast handling of non-trivial amounts of output (it runs your program in a separate process and pipes data to the interactive window over the network. and the interactive seems to be redrawing the display for every lin

Re: references and buffer()

2006-10-08 Thread Theerasak Photha
On 10/8/06, km <[EMAIL PROTECTED]> wrote: > > Hi all, > > was looking at references in python... > >>> a = 10 > >>> b = a > >>> id(a) > 153918788 > >>>id(b) > 153918788 > > where a and b point to the same id. now is this id an address ? The id may be considered similar to an address in

Re: Painless way to do 3D visualization

2006-10-08 Thread Erik Max Francis
Peter Beattie wrote: > faulkner wrote: >> http://www.vpython.org/ > > Oh, thanks, but let me quote myself: > >>> So far, I've only tinkered a little with VPython, but the lack >>> of any decent documentation has proved to be a major turn-off. > > So, I'd really appreciate any hints as to where

Re: recommendations for personal journaling application

2006-10-08 Thread Karsten W.
Hi! Donnie Rhodes wrote: > So what I'm interested in is how this would work. Is this 'event > driven' in nature? Would I define the bulk of these slash commands in a > function and then call it at the end of the script? What would be a > good module to look at for the text processing and searching

Re: Newbie - Stuck

2006-10-08 Thread r3bol
Thanks everyone. I guess I was a little quick to think I could jump straight into Python. I understand the principals of what was said but not the code just yet. I was always under the impression that python was a cleaned up version of perl. I guess this excercise put me straight! I will try and g

Re: references and buffer()

2006-10-08 Thread km
Hi all, in the CPython implementation, it's the address where the object isstored.  but that's an implementation detail.  ok so can i point a vairiable to an address location just as done in C language ? >>> y = 'ATGCATGC' >>> x = buffer(y) >>> del(y) >>> x >>> print x ATGCATGC now even when i

Re: references and buffer()

2006-10-08 Thread Carl Friedrich Bolz
Fredrik Lundh wrote: [snip] >> is id similar to the address of a variable or a class ? > > in the CPython implementation, it's the address where the object is > stored. but that's an implementation detail. Just as an obscure sidenote, in PyPy it is ~address some of the time. This is due to the fa

Re: Newbie - Stuck

2006-10-08 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Thanks everyone. I guess I was a little quick to think I could jump > straight into Python. Well, if you're willing to try diving into it instead of jumping, you might like http://diveintopython.org -- http://mail.python.org/mailman/listinfo/python-list

Re: references and buffer()

2006-10-08 Thread Fredrik Lundh
km wrote: > ok so can i point a vairiable to an address location just as done in C > language ? no. there are no C-style "variables" in Python; just objects and names bound to objects. Python variables are names, not memory locations. > >>> y = 'ATGCATGC' > >>> x = buffer(y) > >>> del(y)

Re: references and buffer()

2006-10-08 Thread Theerasak Photha
On 10/8/06, km <[EMAIL PROTECTED]> wrote: > Hi all, > > > > in the CPython implementation, it's the address where the object is > > stored. but that's an implementation detail. > > ok so can i point a vairiable to an address location just as done in C > language ? > >>> y = 'ATGCATGC' > >>> x

Re: Can't get around "IndexError: list index out of range"

2006-10-08 Thread MonkeeSage
On Oct 8, 1:44 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > but "let's hypergeneralize and treat sequences and mappings as the same > thing" proposals are nothing new; a trip to the archives might be help- > ful. Huh? I don't want to treat sequences and mappings as the same thing. I'm talking a

Re: references and buffer()

2006-10-08 Thread Steve Holden
km wrote: > Hi all, > > in the CPython implementation, it's the address where the object is > stored. but that's an implementation detail. > > > ok so can i point a vairiable to an address location just as done in C > language ? > >>> y = 'ATGCATGC' > >>> x = buffer(y) > >>> del(y

WSGI - How Does It Affect Me?

2006-10-08 Thread Gregory Piñero
So I keep hearing more and more about this WSGI stuff, and honestly I still don't understand what it is exactly and how it differs from CGI in the fundamentals (Trying to research this on the web now) What I'm most confused about is how it affects me. I've been writing small CGI programs in Pytho

PEP 342 misunderstanding

2006-10-08 Thread metamoof
So I've been reading up on all the new stuff in PEP 342, and trying to understand its potential. So I'm starting with a few simple examples to see if they work as expected, and find they dont. I'm basically trying to do the following: for x in range(10): print x*2 but coroutine-style. My in

Re: PEP 342 misunderstanding

2006-10-08 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: def printrange(): > ... for x in range(10): > ... x = yield x > ... print x > ... g = printrange() for x in g: > ... g.send(x*2) > ... > 0 > 1 > None > 4 > 3 > None > 8 > 5 > None > 12 > 7 > None > 16 > 9 > None > > Now, I was expect

Re: PEP 342 misunderstanding

2006-10-08 Thread Jean-Paul Calderone
On 8 Oct 2006 12:33:02 -0700, [EMAIL PROTECTED] wrote: >So I've been reading up on all the new stuff in PEP 342, and trying to >understand its potential. So I'm starting with a few simple examples to >see if they work as expected, and find they dont. > >I'm basically trying to do the following: > >

Re: recommendations for personal journaling application

2006-10-08 Thread Ant
Donnie Rhodes wrote: ... > > Thank you all and I hope I'm not biting off too much at once... Not if you break it up into pieces. Look at the things you want to do, and in the first instance, create a function for each. Then you can start to fill in the blanks, and if neccessary ask back here for

Re: references and buffer()

2006-10-08 Thread km
Hi all,Say that you copy the contents of file foo into file bar and delete the original foo. Of course file bar still exists in this case. Notmuch of a difference; I haven't seen buffer objects yet (I am also newto Python), but the initialization for the buffer probably copieswhatever is in y somew

Re: Can't get around "IndexError: list index out of range"

2006-10-08 Thread Steve Holden
MonkeeSage wrote: > On Oct 8, 1:44 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >>but "let's hypergeneralize and treat sequences and mappings as the same >>thing" proposals are nothing new; a trip to the archives might be help- >>ful. > > > Huh? I don't want to treat sequences and mappings as

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Sybren Stuvel
Gregory Piñero enlightened us with: > So I keep hearing more and more about this WSGI stuff, and honestly I > still don't understand what it is exactly AFAIK it's a standard for web frameworks. In such a framework, you receive a 'request' object, and return a 'response' object. If I'm correct, the

Re: Scientific computing and data visualization.

2006-10-08 Thread Fabian Braennstroem
Hi Bernhard, * [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> > I can definitively second that. ROOT is a bit hard to learn but very, >> > very powerful and PyRoot is really a pleasure to work with. >> >> It sounds interesting. Right now, I use matplotlib for >> 2D plotting and vtk for 3D. Do you

Re: Can't get around "IndexError: list index out of range"

2006-10-08 Thread Fredrik Lundh
MonkeeSage wrote: >> but "let's hypergeneralize and treat sequences and mappings as the same >> thing" proposals are nothing new; a trip to the archives might be help- >> ful. > > Huh? I don't want to treat sequences and mappings as the same thing. > I'm talking about adding two similar convenien

Re: references and buffer()

2006-10-08 Thread Theerasak Photha
On 10/8/06, km <[EMAIL PROTECTED]> wrote: > Hi all, > > > > Say that you copy the contents of file foo into file bar and delete > > the original foo. Of course file bar still exists in this case. Not > > much of a difference; I haven't seen buffer objects yet (I am also new > > to Python), but the

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Theerasak Photha
On 10/8/06, Sybren Stuvel <[EMAIL PROTECTED]> wrote: > > 3. Using IIS at all for that matter, does WSGI work on IIS, do any > > frameworks? > > Why would you want to use that monstrosity? Two words: "contractual obligation" -- Theerasak -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-08 Thread Terry Reedy
"Giovanni Bajo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > tracker. I was claiming that, if such a group was ever formed, it was > better > spent on bug triage rather than keeping their keys ready all day long to > quick-fix any server breakage in minutes. This could be made

Re: print time comparison: IDLE versus terminal on ultra 20

2006-10-08 Thread sam
i was actually experimenting on windows on my own pc before the workstation arrived, and IDLE printed a lot faster on windows than in solaris for me too. i would indeed complain to sun if i had ever got the impression that anyone over there ever knew what was going on... : ) > but on the ot

Re: New-style classes slower than old-style classes? (Was: n-body problem at shootout.alioth.debian.org)

2006-10-08 Thread Peter Maas
Richard Jones wrote: > Giovanni Bajo wrote: [...] >> Anyway, this is a bug on its own I believe. I don't think new-style >> classes are meant to be 25% slower than old-style classes. Can any guru >> clarify this? > > Please try 2.5 - there's been significant optimisation work put into 2.5 I check

Some advice needed on an Tkinter app that I try to write

2006-10-08 Thread Svenn Bjerkem
Hi, Armed with Programming Python 3rd Edition and Learning Python 2nd edition I try to write an application which I at first thought was simple, at least until I was finished with the GUI and then wanted to start putting some data into it. As you will see, the program is not yet finished but I po

Re: Raw beginner....

2006-10-08 Thread Fabio Zadrozny
On 10/8/06, Colin Lehmann <[EMAIL PROTECTED]> wrote: > I am new to Python although I have been using Delphi since version one, > I have been employed as a C and C++ programmer so when I went to Linux > (Ubuntu 5.10) I thought Python looked pretty good. > I downloaded and installed 'Eric Python IDE'

Re: Python to use a non open source bug tracker?

2006-10-08 Thread Martin v. Löwis
Giovanni Bajo schrieb: >>> So, you might prefer 6-10 people to activate a new tracker account >>> faster than light. I'd rather have 3-days delay in administrative >>> issues because our single administrator is sleeping or whatever, and >>> then have 2-3 people doing regular bug processing. > > Ar

Re: Python to use a non open source bug tracker?

2006-10-08 Thread Martin v. Löwis
Paul Boddie schrieb: >> When SF is down, people sometimes send tracker items to >> the pydev list instead, when means someone else (who?) has to put in the >> tracker or it gets lost. > > According to Harald Armin Massa's PostgreSQL talk at EuroPython, the > PostgreSQL people manage all their bugs

Re: Python to use a non open source bug tracker?

2006-10-08 Thread Fredrik Lundh
Martin v. Löwis wrote: >>From my experience with GCC, I can only report that this is definitely > not working. There used to be a mailing list [EMAIL PROTECTED], and > reports got either answered immediately, or not at all. People who > thought they were responsible put the mails in some folder, a

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Sybren Stuvel
Theerasak Photha enlightened us with: >> > 3. Using IIS [...] >> >> Why would you want to use that monstrosity? > > Two words: "contractual obligation" That doesn't answer the question. It only makes me ask it to someone else, namely the parties involved in creating the contract. Sybren -- Sybre

Re: references and buffer()

2006-10-08 Thread km
Hi all, Congratulations, you understand both Hinduism and Python better than Ido now.  :) c.f.http://www.swami-krishnananda.org/brdup/brhad_III-09.html"Kati references, Yajnavalkya, iti?"  the answer lies in a single line as pronounced by sri adi sankaracharya - "aham bramhasmi sivoha sivoham "

Re: Python to use a non open source bug tracker?

2006-10-08 Thread skip
Fredrik> you need tools to help you track the bugs and their status, but Fredrik> you can handle issue registration, discussion, and most Fredrik> maintenance stuff using good old mail just fine. Which is something SourceForge has yet to learn. At work we use a system called RT (http

Re: Python to use a non open source bug tracker?

2006-10-08 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Which is something SourceForge has yet to learn. At work we use a system > called RT (http://www.bestpractical.com/rt/). While it's not perfect, it > does allow submissions and responses via email. That feature alone puts it > miles ahead of SF in my mind. I'm on the

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Damjan
> So I keep hearing more and more about this WSGI stuff, and honestly I > still don't understand what it is exactly and how it differs from CGI > in the fundamentals (Trying to research this on the web now) > > What I'm most confused about is how it affects me. I've been writing > small CGI progr

Re: New-style classes slower than old-style classes? (Was: n-body problem at shootout.alioth.debian.org)

2006-10-08 Thread Peter Maas
Peter Maas schrieb: > 1 runs of nbody.py, time in sec Correction: 1 iterations of advance(). -- Regards/Gruesse, Peter Maas, Aachen E-mail 'cGV0ZXIubWFhc0B1dGlsb2cuZGU=\n'.decode('base64') -- http://mail.python.org/mailman/listinfo/python-list

Re: references and buffer()

2006-10-08 Thread Fredrik Lundh
km wrote: > why is that python doesnt implement direct memory addressing provided a > reference to an object exists ? because Python is a portable high-level language. if you want assembler, you shouldn't use Python. did you read the "reset your brain" article ? -- http://mail.python.org/

  1   2   >