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

2006-10-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Thanks Peter. Yeah I had thought of that earlier, but wasn't sure if > this is a standard design pattern for what I'm trying to achieve. It > seems ugly to me to use 2 classes when you are essentially describing a > single type. To me both Exposed and ExposedType lo

Re: Asychronous execution *with* return codes?

2006-10-08 Thread Fredrik Lundh
utabintarbo wrote: > If so, how do I handle the poll() on long-running processes? Run a > bunch and then start a check loop? or use a thread to keep track of each external process. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode strings, struct, and files

2006-10-08 Thread John Machin
Tom Plunket wrote: > I am building a file with the help of the struct module. > > I would like to be able to put Unicode strings into this file, but I'm > not sure how to do it. > > The format I'm trying to write is basically this C structure: > > struct MyFile > { >int magic; >int flags;

Re: Names changed to protect the guilty

2006-10-08 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> 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 ("blah not False"), > >> > >> "blah not False" -> "

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

2006-10-08 Thread Hendrik van Rooyen
"Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote: 8< > I wonder if we need another "middle" field for holding the "bin/binte" part > (could also hold, e.g. "Van" for those names that use this). NO! - I think of my surname as "van Rooyen"

Re: dictionary containing a list

2006-10-08 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > > One of the fascinating things about c.l.py is that sometimes a questin > > will be posted that makes almost no sense to me, and somebody else will > > casually read the OP's mind, home in on the issue and provide a useful > >

ANN: geopy 0.93 - Geocoding Toolbox for Python

2006-10-08 Thread Brian Beck
Hi everyone, geopy 0.93 was released tonight. What is geopy? == geopy is a geocoding toolbox for Python. It includes support for many popular geocoders including Google Maps, Yahoo! Maps, Virtual Earth, geocoder.us, GeoNames, MediaWiki (with the GIS extension), and Semantic MediaWiki.

Unicode strings, struct, and files

2006-10-08 Thread Tom Plunket
I am building a file with the help of the struct module. I would like to be able to put Unicode strings into this file, but I'm not sure how to do it. The format I'm trying to write is basically this C structure: struct MyFile { int magic; int flags; short otherFlags; char pad[22];

RE: Why do this?

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Golden wrote: > [Matthew Warren] > | But nowadays, I see things like this all over the place; > | > | print("There are %s ways to skin a %s" % (number, furryanimal)) > > The outermost brackets are (at the moment) unnecessary in python, > altho' print is slated

Re: Why do this?

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > Corrado Gioannini <[EMAIL PROTECTED]> wrote: > >> I often do things like this: >> >> sql = a_complex_select_sql % (id_foo, value_bar, ...) >> cursor.execute(sql) >> >> inside the body of a function (or a class method), where >> a_complex

Re: changing a file's permissions

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Max Erickson wrote: > James <[EMAIL PROTECTED]> wrote: > >> So my question is: how does one change a file's permissions >> inside of python? > > Assuming you want to operate on the output file: > > import os > os.chmod(path, 755) Shouldn't that be os.chmod(p

Re: CGI Tutorial

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Clodoaldo Pinto Neto wrote: > 2006/10/4, Tim Chase <[EMAIL PROTECTED]>: > >> The code is very dangerous...allowing any ol' schmoe to run >> arbitrary code on your server. At the barest of minimums, I'd >> plaster the code with warnings that this is a Very Dangerous

Re: CGI Tutorial

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steve Holden wrote: > Credit card numbers should be encrypted in the database, of course, but > they rarely are (even by companies whose reputations imply they ought to > know better). How would encryption help? They'd still have to be decrypted to be used. -- htt

Re: Asychronous execution *with* return codes?

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, utabintarbo wrote: > Justin wrote: >> If you're on a POSIX system, you could use the usual fork/exec/wait: >> > Sorry. Win32. We are only allowed spoons - no sharp objects. :-P How about installing Cygwin, then, and running under that? -- http://mail.python.org/m

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread goon
> Trying to research this on the web now Lots of articles now appearing summarising WSGI ... For definitive reference: [0] Overview: [1] and [2] Reference [0] python.org,

Re: Python license question

2006-10-08 Thread Terry Reedy
"Tim Peters" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm not a lawyer, so can't give legal advice. I can explain intent, > speaking as a Director of the Python Software Foundation. This strikes me as an excellent reply, which would be worth adding to the site as a FAQ (po

Re: Python license question

2006-10-08 Thread Tim Peters
[Martitza] > Mr. Peters: Na, my father's dead -- you can call me Uncle Timmy ;-) > Thank you for so kindly taking the time to resolve my misunderstandings > and to elaborate on the intent of the PSF. > > In particular, thank you for explaining in plain language how the > licenses stack. I'm sure

Re: Dive Into Java?

2006-10-08 Thread Jorge Vargas
Sun's Java tutorial, and went your confortable with it. Thinking in Java Bruce Eckel On 8 Oct 2006 15:30:15 -0700, erikcw <[EMAIL PROTECTED]> wrote: > DiveIntoPython.org was the first book I read on python, and I really > got a lot out of it. I need to start learning Java (to maintain a > projec

Re: Python license question

2006-10-08 Thread Martitza
Mr. Peters: Thank you for so kindly taking the time to resolve my misunderstandings and to elaborate on the intent of the PSF. In particular, thank you for explaining in plain language how the licenses stack. I'm sure our counsel will figure out what a license from a defunct BeOpen means and any

Re: Raw beginner....

2006-10-08 Thread jmdeschamps
Fabio Zadrozny wrote: > 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 downloade

Re: Dive Into Java?

2006-10-08 Thread jmdeschamps
erikcw wrote: > DiveIntoPython.org was the first book I read on python, and I really > got a lot out of it. I need to start learning Java (to maintain a > project I've inherited), and was wondering if anyone knew of any > similar books for Java? > > Maybe once I know my way around the language, I

Re: Python license question

2006-10-08 Thread Tim Peters
[Martitza] |> Hi. I work for a small company (actually in process of forming) > interested in embedding or extending python as part of our commercial > non-open-source product. We have legal counsel, but are interested in > the spirit as well as the letter of the law. Not much seems to have > be

Re: Google breaks Usenet (was Re: How can I correct an error in an old post?)

2006-10-08 Thread Blair P. Houghton
Bryan Olson wrote: > Aahz wrote: > > The problem is the network effect. In this case, what Google has that > > can't be replicated is the history of posts. > > There's no magic there. Get them the same way Google and > Dejanews got them, plus you might scrape Google, from some > locality with fav

Re: Google breaks Usenet (was Re: How can I correct an error in an old post?)

2006-10-08 Thread Blair P. Houghton
Bryan Olson wrote: > Blair P. Houghton wrote: > > Usenet isn't just the "send this message to all leaf nodes via tree" > > behavior, > > it's the "show me the message from 1987 or 1988 written by dickie > > sexton where > > he invents the '(*plonk*)' meme" behavior, and a lot of others. > > That m

Python license question

2006-10-08 Thread Martitza
Hi. I work for a small company (actually in process of forming) interested in embedding or extending python as part of our commercial non-open-source product. We have legal counsel, but are interested in the spirit as well as the letter of the law. Not much seems to have been written about the p

Google code search (Was: Names changed to protect the guilty)

2006-10-08 Thread Nils R Grotnes
Google has a cool new service. http://www.google.com/codesearch You can use regular expressions! (I found at least 13 distinct utilities that used the idiom.) Nils -- http://mail.python.org/mailman/listinfo/python-list

Re: recommendations for personal journaling application

2006-10-08 Thread [EMAIL PROTECTED]
before you use re there is a quote I have seen on different boards to remember. So you have a problem and you want to use re now you have two problems. It was someone from thescripts.com that helped me realise how to fix my program without re. (sorry if I have thier website name somewhat wro

Dive Into Java?

2006-10-08 Thread erikcw
DiveIntoPython.org was the first book I read on python, and I really got a lot out of it. I need to start learning Java (to maintain a project I've inherited), and was wondering if anyone knew of any similar books for Java? Maybe once I know my way around the language, I can sneak Jython in... :-

Re: testing machine responsiveness

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Arnold wrote: > try: > s.connect((cpu,7)) > except: > return 0 > try: > s.send('test') > s.recv(128) > s.close() > return 1 > except: > return 0

Re: recommendations for personal journaling application

2006-10-08 Thread Terry Reedy
"Donnie Rhodes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] keyword/keyphrase. > > So what I'm interested in is how this would work. Is this 'event > driven' in nature? I would call it line-input driven -- a special case that is easier to program. > Would I define the bulk of t

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

2006-10-08 Thread MonkeeSage
On Oct 8, 3:05 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > No: you are proposing to add features to the sequence interface for > which there are few demonstrable use cases. If I really wanted to find them, how many instances do you think I could find [in the standard lib and community-respected

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

2006-10-08 Thread MrJean1
On my Ultra 20 box, the test program takes 0.00039982 secs in a terminal window and 0.236839 secs in IDLE, i.e. about 600x slower. This is ActivePython 2.4.3 for Solaris 10 on a 2+ GHz Opteron. A partial explanation for the difference in run time between terminal and IDLE is that IDLE uses thru a

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

2006-10-08 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, John Machin wrote: > Two problems so far: > (1) If you then assume that you should print the phone directory in > order of family name, that's not appropriate in some places e.g. > Iceland; neither is addressing Jon Jonsson as "Mr Jonsson", and BTW it > can be their

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread fumanchu
Gregory Piñero wrote: > Examples of how frameworks don't meet my needs sometimes: > 1. Working with SQL Server (Most frameworks seem to at least make it extra > work) I don't know about "most frameworks", but there are certainly some that work with SQL Server. My Dejavu ORM does SQL Server and MS

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/

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: 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: 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: 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: 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: 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: 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: 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 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: 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'

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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

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

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

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 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: 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: 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 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: 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: 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: 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: 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: 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: 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 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

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: 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:

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 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

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: 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) :

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: 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

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: 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

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: 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

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: 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: >

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: 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: 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: 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: 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: 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: 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 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 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 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
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: > 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

  1   2   >