Re: [Tutor] unicode and character sets

2007-08-16 Thread tpc247
On 8/16/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > Good start! thanks, one of the good folks at metafiler provided the link to an excellent introductory article I don't think this is necessary. Did it actually fix anything? Changing > the default encoding is not

Re: [Tutor] unicode and character sets

2007-08-16 Thread tpc247
On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > thanks, one of the good folks at metafiler provided the link to an > excellent introductory article > > correction: metafilter ___ Tutor maillist - Tutor@python.org http://mail.python.org/

[Tutor] Opening Multiple Files

2007-08-16 Thread Paulo Quaglio
Hi everyone, Thanks for all suggestions. Let me just preface this by saying that I’m new to both python and programming. I started learning 3 months ago with online tutorials and reading the questions you guys post. So, thank you all very, very much…and I apologize if I’m doing something reall

Re: [Tutor] Simple way to compare Two lists

2007-08-16 Thread Stephen McInerney
Jim & Jaggo - Dict lookup is (essentially) constant-time because the hashing function computes which unique bucket a given entry will correspond to. (Hashing functions are usually polynomials involving prime numbers. Can assume that the computation of the hash value is constant-time) So there is

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Stephen McInerney
Yes but it's still a canonical question about analysis of weakly-typed dynamic languages, since my Java friend makes separate comments about scalability when analyzing large builds - he claims 1-5m lines of code is a threshold. >From: Kent Johnson <[EMAIL PROTECTED]> >To: Kevin Cameron <[EMAIL P

Re: [Tutor] Simple way to compare Two lists

2007-08-16 Thread jim stockford
Why is a dict lookup constant time. I.e. if there's a loop that walks a (shorter) list and compares each element with each element of a dict, what's going on to make this faster than an outer loop walking a list and an inner loop walking a second list? On Aug 16, 2007, at 5:01 PM, Stephen McIne

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Kent Johnson
Kevin Cameron wrote: > Stephen McInerney wrote: >> My friend said the runtime efficiency of Doxygen on his build was much >> worse on the Python code than the C++ code, i.e. it took ages to parse >> the Python code. > It's not the efficiency of doxygen that's the question. The problem is > that yo

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread Kent Johnson
wesley chun wrote: > that's great clarification... you are right on. memory references (as > in C) are different from object references in Python, and yes, it's > the object references that are passed and up to the object's > mutability on whether assignment to that object is possible. As long as

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Kevin Cameron
Stephen McInerney wrote: > My friend said the runtime efficiency of Doxygen on his build was much > worse on the Python code than the C++ code, i.e. it took ages to parse > the Python code. It's not the efficiency of doxygen that's the question. The problem is that you can add fields to objects as

Re: [Tutor] Simple way to compare Two lists

2007-08-16 Thread Stephen McInerney
Sorting both lists is unnecessary and not very scalable (order(NlogN)). Assuming the lists do not contain duplicates, just turn the longer one into a dict and check that each element of the shorter list in that dict (e.g. "if j not in BigList: return false") Since dict lookup is constant-time O(

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Stephen McInerney
My friend clarifies: "It's not the efficiency of doxygen that's the question. The problem is that you can add fields to objects as you go in Python so you need to do a deep analysis of the code to determine the class structure which you don't have to do with C++ (or Java)." He mentioned numbers

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Alan Gauld
"Stephen McInerney" <[EMAIL PROTECTED]> wrote > My friend said the runtime efficiency of Doxygen on his build was > much > worse on the Python code than the C++ code, i.e. it took ages to > parse > the Python code. > > Anyone agree/disagree, or have any efficiency tips on how to > structure >

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread wesley chun
> > in python, *everything* is call by reference > > Python passes object references by value. This is not the same as call > by reference. With call by reference, *assignment* to a function > parameter changes the value seen by the caller. This is not possible in > Python. that's great clarifica

[Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Stephen McInerney
My friend said the runtime efficiency of Doxygen on his build was much worse on the Python code than the C++ code, i.e. it took ages to parse the Python code. Anyone agree/disagree, or have any efficiency tips on how to structure things for decent Doxygen performance? (I haven't used Doxygen myse

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread bhaaluu
Greetings, The site in question ( http://osl.iu.edu/~lums/swc/ ) is listed at ( http://python.org/ ) on the right-hand sidebar entitled: Using Python For... # Education # pyBiblio, Software Carpentry Course Perhaps these concerns should be directed to either the maintainers of Python.Org ( http:

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread Kent Johnson
wesley chun wrote: > in python, *everything* is call by reference Not sure I really want to get into this, but here goes... Python passes object references by value. This is not the same as call by reference. With call by reference, *assignment* to a function parameter changes the value seen by

Re: [Tutor] PyCon 2008 - Call for Tutorial Ideas

2007-08-16 Thread Kent Johnson
Greg Lindstrom wrote: > What tutorials would YOU like to see offered? Please response to: > [EMAIL PROTECTED] Maybe intermediate Python? I have been giving a series of presentations to my local Python SIG about topics that are widely applicable but often overlooked

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread wesley chun
> Python copies variables' values when passing them to functions > a.. Since Booleans, numbers, and strings can't be updated, a > function can't affect its caller's values > b.. But if you pass a list to a function, the function will operate > on the original list, not a copy >

[Tutor] PyCon 2008 - Call for Tutorial Ideas

2007-08-16 Thread Greg Lindstrom
Hey Everyone- I posted this to the python list, but then thought the tutor list might be a better place to get ideas. So It's hard to believe, but the planning for PyCon 2008 is underway. PyCon, an annual gathering of Python enthusiasts -- nearly 600 in Dallas last year -- will be held in C

Re: [Tutor] Simple way to compare Two lists

2007-08-16 Thread Jaggo
Thank you Kent, Michael, Tom and anyone else I'm forgetting who took time to reply. I don't work quite so fast, very limited personal computer time means I only do it on weekends, I read through your suggestions and eventually found a way to speed-up the proccess through sorting the Two lists,

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-16 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > At 02:41 AM 8/16/2007, Alan Gauld wrote: >>But Python 3000 is a semi mythical fancy that doesn't exist and may >>never exist. > > "We're closing in on the first Python 3000 alpha release (promised > for the end of August)." >

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread Alan Gauld
"Tim Michelsen" <[EMAIL PROTECTED]> wrote >> Have you seen this site yet? >> >> http://osl.iu.edu/~lums/swc/ A new one to me. its not bad but does contain some downright misleading bits, for example a quick scan of the functions topic yielded: --- Python copies variables' values whe

Re: [Tutor] FAQ [Was Re: Python Book Recommendations [Was:....]]

2007-08-16 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld > Sent: Tuesday, August 14, 2007 10:06 AM > To: tutor@python.org > Subject: Re: [Tutor] FAQ [Was Re: Python Book Recommendations > [Was:]] > > > "Tim Michelsen" <[EMAIL PROTECTED]> wro

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread wormwood_3
Yeah, I loved this! I did not even know you could put variables and keywords in bookmarks like this. Awesomely cool. For anyone interested in more details, Lifehacker has a great article on this, associated plugins, tips and tricks: http://lifehacker.com/software/bookmarks/hack-attack-firefox-a

Re: [Tutor] Class Attribute "Overloading?"

2007-08-16 Thread Vincent Gulinao
I see, I think "property" is what I'm looking for. But how would you design it yourself (you said it's a little ugly, I love to hear better ideas)? My only concern is to avoid unnecessary DB accesses (or any other expensive processes). Thanks. On 8/16/07, Tiger12506 <[EMAIL PROTECTED]> wrote: >

Re: [Tutor] Python 3000

2007-08-16 Thread Kent Johnson
Dick Moores wrote: > At 02:41 AM 8/16/2007, Alan Gauld wrote: >> But Python 3000 is a semi mythical fancy that doesn't exist and may >> never exist. >> It is where all the ills of Python will be cured. Saying it is in Python 3000 >> is usually a synonym for it won't be "fixed" anytime soon! > > B

Re: [Tutor] Fw: KeyError list?

2007-08-16 Thread Rob Andrews
I wasn't familiar with it prior to this thread, as previously I'd had the good fortune to use normalized data. I guess more pristine data environments spoiled me into writing less robust code. So although I asked what turned out to be the wrong question, I seem to be getting a consensus answer I'm

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-16 Thread Dick Moores
At 02:41 AM 8/16/2007, Alan Gauld wrote: >But Python 3000 is a semi mythical fancy that doesn't exist and may >never exist. >It is where all the ills of Python will be cured. Saying it is in Python 3000 >is usually a synonym for it won't be "fixed" anytime soon! But have you seen what Guido says?

Re: [Tutor] unicode and character sets

2007-08-16 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > http://www.joelonsoftware.com/articles/Unicode.html > > I realize the following: It does not make sense to have a string without > knowing what encoding it uses. There is no such thing as plain text. Good start! > > Ok. Fine. In Mozilla, by clicking on View, Charac

Re: [Tutor] Fw: KeyError list?

2007-08-16 Thread Kent Johnson
Rob Andrews wrote: > Attempting to massage these into files I can process has involved a > lot of "throw-away" scripting, and I've caught myself doing some > really questionable things with basic data structures, leading to my > original question. Dictionary key errors have been the most common > h

[Tutor] unicode and character sets

2007-08-16 Thread tpc247
dear fellow Python enthusiasts, I recently wrote a script that grabs a file containing a list of ISO defined countries and creates an html select element. That's all well and good, and everything seems to work fine, except for one little nagging problem: http://en.wikipedia.org/wiki/Aland_Island

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-16 Thread Tim Michelsen
Hey bhaaluu and list, > Have you seen this site yet? > > http://osl.iu.edu/~lums/swc/ Many many thanks for this link. Although it should be the most obvious to head to the source (python.org) I didn't go there. The above mentioned tutorial seem to cover exactly what I need and where I want do

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-16 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > I can't figure out how to do it for > n = 1,987,087,234,456 # no quotes > (I want to be able to type in big ints using commas--much easier to > see that I've typed correctly) I don't think you can. You are basically asking "how can I break the syntax rul

Re: [Tutor] converting a source package into a dll/shared library?

2007-08-16 Thread Duncan Gibson
Alan asked me: > As to access to the internal data would it be difficult to > parameterise it so that each companies data is in a > local config file? That way even if the dissasemble > the code it won't help? Unfortunately no. The input files are human readable geometrical models. Each tool ha