Re: Python vs. Lisp -- please explain

2006-02-22 Thread Rocco Moretti
Alexander Schmolck wrote: > I wanted to point > out that one could with just as much justification claim CL to be more dynamic > than python (it is in some regards, but not in others -- how to weight them to > achieve some overall "score" is not obvious. I think it's worth pointing out that not a

Re: can't use NetcdfFile

2006-02-22 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > Hi, > I'm trying to open a Netcdf file using NetcdfFile but I always get an > import error DLL failed > even though I've tried using all these: > > import Numeric > from Scientific.IO.NetCDF import NetCDFFile > from Scientific.IO import NetCDF > from Scientific import *

Re: That's really high-level: bits of beautiful python

2006-02-21 Thread Rocco Moretti
Max wrote: > But today we were discussing the problem of running externally-provided > code (e.g. add-on modules). Neither of us knew how to do it in C, though > I suggested using DLLs. However, I quickly installed python on his > laptop and coded this: > > exec "import %s as ext_mod" % raw_in

Re: Mutable numbers

2006-02-21 Thread Rocco Moretti
Steve Holden wrote: > fraca7 wrote: > >> The memory allocation for integers is optimized. 'Small' integers >> (between -5 and 100 IIRC) are allocated once and reused. The memory >> for larger integers is allocated once and reused whenever possible, so >> the malloc() overhead is negligible. >

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-17 Thread Rocco Moretti
Steven D'Aprano wrote: > Anybody using Python *should* be aware of the division issue. As soon as > they see a division, it is their responsibility to *find out what it > means*. That doesn't require much work: they can scroll up to the > beginning of the module and look at the first few lines. Th

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-14 Thread Rocco Moretti
Gregory Piñero wrote: > On 14 Feb 2006 06:44:02 -0800, [EMAIL PROTECTED] > > >>5./2.=2.5 is floating point math, with all the round off errors that >>incorporates. > > Thanks Curtis, I never knew that trick. I guess for variables do have > true division you have to make them floats? e.g. > flo

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Rocco Moretti
Erik Max Francis wrote: > If a 4-tuple is a quadruple, a 3-tuple is a triple, a > 2-tuple is an pair, then I guess a 1-tuple would be a single. Granted > that's not nearly as gruesome enough a name to go with the special > lopsided Pythonic creature mentioned above. I suggest we name it a > h

Re: Compiling

2006-02-03 Thread Rocco Moretti
Simon Faulkner wrote: > Pardon me if this has been done to death but I can't find a simple > explanation. > > I love Python for it's ease and speed of development especially for the > "Programming Challenged" like me but why hasn't someone written a > compiler for Python? > > I guess it's not

Re: locals() and dictionaries

2006-02-01 Thread Rocco Moretti
JerryB wrote: > Hi, > I have a dictionary, a string, and I'm creating another string, like > this: > > dict = {} > dict[beatles] = "need" > str = "love" > > mystr = """All you %(dict[beatles])s is %(str)s""" % locals() > > Why do I get > keyerror: 'dict[one]'? > > Is there a way to reference th

Re: Using non-ascii symbols

2006-01-27 Thread Rocco Moretti
Ivan Voras wrote: > It's not a far-out idea. I stumbled about a year ago on a programming > language that INSISTED on unicode characters like ≤ as well as the rest > of mathematical/logical symbols; I don't remember its name but the > source code with characters like that looked absolutely beau

Re: beta.python.org content

2006-01-27 Thread Rocco Moretti
Paul Boddie wrote: > With the nice font they've used, I don't understand why they didn't > turn the "p" into a snake itself. I'm sure I've seen that done > somewhere before. You're probably thinking of PyPy: http://codespeak.net/pypy/dist/pypy/doc/news.html -- http://mail.python.org/mailman/lis

Re: Question about isinstance()

2006-01-26 Thread Rocco Moretti
Mr.Rech wrote: > All in all it seems that the implementation that uses isinstance() is > better in this case... Well what's "better" depends on what you want to happen when you compare an unrelated class that also defines 'an_attribute'. Unlike in statically typed languages, certain things are m

Re: beta.python.org content

2006-01-26 Thread Rocco Moretti
Peter Maas wrote: > - The logo does indeed resemble a cross. How about rotating it at 45 deg > to make it look like an x? Or give it a circular shape? Please note > that there are no religious motives in this remark :) It looks like a plus sign to me. Do you also advocate renaming "C++" to "

Re: Question about isinstance()

2006-01-26 Thread Rocco Moretti
Dave Benjamin wrote: > On Thu, 26 Jan 2006, Mr.Rech wrote: > >> Suppose I'm writing a base class with an __eq__ special methods, using >> isinstance() I would have wrote: >> >> class foo(object): >>... >>def __eq__(self, other): >> return isinstance(other, type(self)) and self.an_at

Re: Using non-ascii symbols

2006-01-26 Thread Rocco Moretti
Terry Hancock wrote: > One thing that I also think would be good is to open up the > operator set for Python. Right now you can overload the > existing operators, but you can't easily define new ones. > And even if you do, you are very limited in what you can > use, and understandability suffers.

Re: Using non-ascii symbols

2006-01-24 Thread Rocco Moretti
Robert Kern wrote: > Rocco Moretti wrote: > > [James Stroud wrote:] > >>>>>I can't find "?, ?, or ?" on my keyboard. >> >>Posting code to newsgroups might get harder too. :-) > > > His post made it through fine. Your newsreader

Re: Using non-ascii symbols

2006-01-24 Thread Rocco Moretti
Giovanni Bajo wrote: > Robert Kern wrote: > > >>>I can't find "?, ?, or ?" on my keyboard. Posting code to newsgroups might get harder too. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: list(...) and list comprehensions (WAS: Arithmetic sequences in Python)

2006-01-20 Thread Rocco Moretti
Antoon Pardon wrote: > Well we could have list(a) return [a], and have a list_from_iterable. > Although I would prefer a different name. Or reverse it - list() always takes a single iterable, and list_from_scalars() is defined something like follows: >>> def list_from_scalars(*args): retu

Re: OT: excellent book on information theory

2006-01-18 Thread Rocco Moretti
Alex Martelli wrote: > Terry Hancock <[EMAIL PROTECTED]> wrote: >... > >>due to the Evil Conspiracy of region-coding, I couldn't >>watch the British DVD even if I were to import it (Well, >>yeah I could, but it would be painful, and probably illegal, > > > I have a region-free DVD player her

Re: making objects unassignable "read-only" (especially when extending)

2006-01-18 Thread Rocco Moretti
Johannes Zellner wrote: > Hi, > > can I make an object read-only, so that > > x = new_value > > fails (and x keeps it's orginal value)? Simon gave you a way of doing it when x is an attribute access (e.g. p.x). I am unaware of a way of doing it when x is a straight global or local. Unlike

Re: Decimal ROUND_HALF_EVEN Default

2006-01-17 Thread Rocco Moretti
LordLaraby wrote: > If 'bankers rounding' is HALF_ROUND_EVEN, what is HALF_ROUND_UP? I > confess to never having heard the terms. There was a Slashdot article on rounding a short while back: http://developers.slashdot.org/article.pl?sid=06/01/05/1838214 -- http://mail.python.org/mailman/listinfo

Re: New Python.org website ?

2006-01-11 Thread Rocco Moretti
Roy Smith wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: > >>http://beta.python.org > > All I can say is, "Wow!". If nothing else, it will forever eliminate the > idea that the web site doesn't look professional. It's almost *too* slick. I agree with the "too slick" impression. The "learn w

Re: Converting milliseconds to human amount of time

2006-01-09 Thread Rocco Moretti
Max wrote: > Harlin Seritt wrote: > >> How can I take a time given in milliseconds (I am doing this for an >> uptime script) and convert it to human-friendly time i.e. "4 days, 2 >> hours, 25 minutes, 10 seonds."? Is there a function from the time >> module that can do this? >> >> Thanks, >> >> Ha

Re: inline function call

2006-01-04 Thread Rocco Moretti
Riko Wichmann wrote: > hi everyone, > > I'm googeling since some time, but can't find an answer - maybe because > the answer is 'No!'. > > Can I call a function in python inline, so that the python byte compiler > does actually call the function, but sort of inserts it where the inline > call

Re: One-step multiples list generation?

2006-01-03 Thread Rocco Moretti
Damien Wyart wrote: > * Efrat Regev <[EMAIL PROTECTED]> in comp.lang.python: > >>Suppose I have some non-numerical Foo and would like to create a list >>of 20 Foo-s. Is there a one-step method (not a loop) of doing so? > > > Maybe : > > [ Foo ] * 20 > > or, more verbose, > > [ Foo for _ in ra

Re: One-step multiples list generation?

2006-01-03 Thread Rocco Moretti
Rocco Moretti wrote: > Damien Wyart wrote: > >> * Efrat Regev <[EMAIL PROTECTED]> in comp.lang.python: >> >>> Suppose I have some non-numerical Foo and would like to create a list >>> of 20 Foo-s. Is there a one-step method (not a loop) of doing so? >&

Re: deal or no deal

2005-12-22 Thread Rocco Moretti
rbt wrote: > The TV show on NBC in the USA running this week during primetime (Deal > or No Deal). I figure there are roughly 10, maybe 15 contestants. They > pick a briefcase that has between 1 penny and 1 million bucks and then > play this silly game where NBC tries to buy the briefcase from

Re: Guido at Google

2005-12-21 Thread Rocco Moretti
Jack Diederich wrote: > On Wed, Dec 21, 2005 at 01:36:42PM -0500, rbt wrote: > >>Alex Martelli wrote: >> >>>I don't think there was any official announcement, but it's true -- he >>>sits about 15 meters away from me;-). >> >>For Americans: 15 meters is roughly 50 feet. > > > Right, so that is ab

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > Chris Mellon wrote: > >>Any time you want to write something in any way other than the obvious >>way, ask yourself why? Is it more obvious *to you*, which is a good >>reason as long as you're only writing code for yourself? Or is it just >>to be different, or because you

Re: How to find the type ...

2005-12-09 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: thisisastring = "1" thisisanint = 1 type(thisisastring) > > > type(thisisanint) > > > thisisastring = int(thisisastring) thisisanint = str(thisisanint) type(thisisastring) > > > type(thisisanint) > > >>> print repr(thisisastring)

Re: Bitching about the documentation...

2005-12-08 Thread Rocco Moretti
Fredrik Lundh wrote: > Rocco Moretti wrote: > > >>Insert punctuation & capitalization to make the following a correct and >>coherent (if not a little tourtured). >> >>fred where guido had had had had had had had had had had had a better >>effect on the

Re: Bitching about the documentation...

2005-12-07 Thread Rocco Moretti
>>>One of my favourite examples of obfuscated English is this grammatically >>>correct sentence: >>> >>>"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo." > > The punctuation is important. Reminds me of this old classic: Insert punctuation & capitalization to make the following

Re: Documentation suggestions

2005-12-07 Thread Rocco Moretti
A.M. Kuchling wrote: > There's another struggle within the LibRef: is it a reference or a > tutorial? Does it list methods in alphabetical order so you can look > them up, or does it list them in a pedagogically useful order? I > think it has to be a reference; if each section were to be a tutor

Re: python university search

2005-12-05 Thread Rocco Moretti
josh wrote: > > hello, > > i am interested in doing an undergraduate major in computer science > that mainly focuses on python as a programming language.. It's your life, so you can live it as you choose, but I think you're missing the point of an undergraduate education if you focus too much o

Re: General question about Python design goals

2005-12-01 Thread Rocco Moretti
Fredrik Lundh wrote: > Rocco Moretti wrote: > >>>>I'm sure Antoon wouldn't object if lists were to be allowed as >>>>dictionary keys, which would eliminate the multiple castings for >>>>that situation. I wouldn't, either. >>

Re: General question about Python design goals

2005-12-01 Thread Rocco Moretti
Fredrik Lundh wrote: > Rick Wotnaz wrote: > > >>I'm sure Antoon wouldn't object if lists were to be allowed as >>dictionary keys, which would eliminate the multiple castings for >>that situation. I wouldn't, either. > > so what algorithm do you suggest for the new dictionary im- > plementation?

Re: Which License Should I Use?

2005-11-28 Thread Rocco Moretti
mojosam wrote: > I've been watching the flame war about licenses with some interest. > There are many motivations for those who participate in this sector, so > disagreements over licenses reflect those agendas. One point that frequently gets ignored in licensing debates: The value of a license i

Re: Which License Should I Use?

2005-11-28 Thread Rocco Moretti
Steven D'Aprano wrote: > On Fri, 25 Nov 2005 11:30:46 -0800, mojosam wrote: > >>I guess I don't care too much about how other people use it. > > Then probably the best licence to use is just to follow the lead of > Python. For that sort of small program of limited value, I put something > like th

Re: [Fwd: Re: hex string to hex value]

2005-11-22 Thread Rocco Moretti
tim wrote: > ok, but if i do > > >>> n=66 > >>> m=hex(n) > >>> m > '0x42' > >>> h=int(m,16) > >>> h > 66 > >>> > > I end up with 66 again, back where I started, a decimal, right? > I want to end up with 0x42 as being a hex value, not a string, so i can > pas it as an argument to a function

Re: Adding through recursion

2005-11-18 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > There is problaly a really simple answer to this, but why does this > function print the correct result but return "None": > > def add(x, y): > if x == 0: > print y > return y > else: > x -= 1 > y += 1 > add(x, y) > > prin

Re: Proposal for adding symbols within Python

2005-11-16 Thread Rocco Moretti
Pierre Barbier de Reuille wrote: > Rocco Moretti a écrit : > [...] > >> >>I did, but I still don't see why it is an argument against using >>strings. The point you may not appreciate is that (C)Python already uses >>strings to represent names, as an important

Re: Proposal for adding symbols within Python

2005-11-15 Thread Rocco Moretti
Björn Lindström wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > >>Why does the byte string "\x6f\x70\x65\x6e\x65\x64" have intrinsic >>meaning when the int 0 doesn't? It certainly doesn't mean anything to >>non-English speakers. >> >>If all you want is human readable byte strings, then j

Re: is parameter an iterable?

2005-11-15 Thread Rocco Moretti
marduk wrote: > On Tue, 2005-11-15 at 11:01 -0800, py wrote: > >>I have function which takes an argument. My code needs that argument >>to be an iterable (something i can loop over)...so I dont care if its a >>list, tuple, etc. So I need a way to make sure that the argument is an >>iterable befo

Re: Proposal for adding symbols within Python

2005-11-14 Thread Rocco Moretti
Pierre Barbier de Reuille wrote: > Please, note that I am entirely open for every points on this proposal > (which I do not dare yet to call PEP). I still don't see why you can't just use strings. The only two issues I see you might have with them are a) two identical strings might not be identi

Re: Map of email origins to Python list

2005-11-07 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > Rocco Moretti wrote: > >>It's also a testament to the limited value of physically locating people >>by internet addresses - If you zoom in on the San Fransico bay area, and >>click on the southern most bubble (south of San Jose), you'l

Re: [OT] Map of email origins to Python list

2005-11-07 Thread Rocco Moretti
Paul McGuire wrote: > "Claire McLister" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > We've been working with Google Maps, and have created a web service to > map origins of emails to a group. As a trial, we've developed a map of > emails to this group at: > > http://www.zees

Re: I Need Motivation Part 2

2005-11-04 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > i m losing my motivation with python because there are sooo many > modules, that i cant just learn them all, As other's have said, don't bother. If you ever need to use a module that you don't know, just go to http://docs.python.org/lib/lib.html (easily accessable fr

Re: Python's website does a great disservice to the language

2005-11-03 Thread Rocco Moretti
Alex Martelli wrote: > The Eternal Squire <[EMAIL PROTECTED]> wrote: >... > >>2) Consider what he really wants for a supervisor of software >>engineers. Ideally such a person should be a software engineer with >>at least 3 times the experience of the most junior member. Such a > > > I li

Re: Suggestion for (re)try statement

2005-11-02 Thread Rocco Moretti
Sori Schwimmer wrote: > 0) Sorry, I don't know how to post a reply in the same > thread. Usually it is simply hitting the "Reply" button/link/key combination on your mail/news reader when the post you want to reply to in view. (If you want reply to multiple people, you can always reply to the or

Re: Python's website does a great disservice to the language

2005-11-01 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > So the first thing you do when you go to a web page is to google if > they are going to redesign it? I think the implication was "The first thing to do before *suggesting that a redesign is nessasary* is to Google to see if such a redesign is taking place." -- http://

Re: Suggestion for (re)try statement

2005-10-28 Thread Rocco Moretti
Sori Schwimmer wrote: > Hi, > > I think that would be useful to have an improved > version of the "try" statement, as follows: > > try(retrys=0,timeout=0): > # things to try > except: > # what to do if failed > > and having the following semantic: > > for i in range(retrys): > try: >

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-20 Thread Rocco Moretti
James Stroud wrote: > I propose that any time anyone suggests switching to Windows, the reasons for > such should be explicitly described, and not left to interpretation. I propose that any time anyone suggests switching to Linux ... I propose that any time anyone suggests switching to Mac ... I

Re: Very dumb question

2005-10-12 Thread Rocco Moretti
Laszlo Zsolt Nagy wrote: > Laszlo Zsolt Nagy wrote: > >> I have a program with this code fragment: >> >>print len(data) >>print data[:50] >>raise SystemExit >> >> This prints: >> >> 20381 >> > >> But if I change 50 to 51 >> >>print len(data) >>print data[:51] >>raise System

Re: When someone from Britain speaks, Americans hear a "Britishaccent"...

2005-10-10 Thread Rocco Moretti
Duncan Smith wrote: > Steve Holden wrote: > >>There are special rules for the monarchs, who are expected to refer to >>themselves in the first person plural. >> > > Yes, although I'm not actually sure where the 'royal we' comes from; I was under the (probably misinformed) impression that since

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Rocco Moretti
Steve Holden wrote: >> On Fri, 07 Oct 2005 00:33:43 -, Grant Edwards <[EMAIL PROTECTED]> >> wrote: >>> For example: In British English one uses a plural verb when the >>> subject consists of more than one person. Sports teams, >>> government departments, states, corporations etc. are gramma

Re: Reply-To header

2005-10-03 Thread Rocco Moretti
Roel Schroeven wrote: > Peter Decker wrote: > >>On 10/3/05, Roel Schroeven <[EMAIL PROTECTED]> wrote: >> >>On lists like this, where everyone benefits by sharing information, it >>seems pretty lame to hide behind purist arguments about Reply-To: >>headers. The default behavior should be the one mo

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

2005-09-30 Thread Rocco Moretti
Reinhold Birkenfeld wrote: > Hi, > > after Guido's pronouncement yesterday, in one of the next versions of Python > there will be a conditional expression with the following syntax: > > X if C else Y Any word on chaining? That is, what would happen with the following constructs: A if B else C

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

2005-09-30 Thread Rocco Moretti
Paul Rubin wrote: > I don't know of a single program that's actually relying on the > non-enforcement. I've asked for examples but have only gotten > theoretical ones. As far as I can tell, the feature is useless. I'd like to turn the question around on you - can you come up with an instance w

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

2005-09-30 Thread Rocco Moretti
Antoon Pardon wrote: >>What if the class author removes a non-private variable or changes a >>method's documented parameters in the next version of the class, because >>he think it'll work better, or just because he can? > > Changing an interface is different from changing the implementation.

Re: A rather unpythonic way of doing things

2005-09-29 Thread Rocco Moretti
fraca7 wrote: > Richie Hindle a écrit : > >> [Peter] >> >>> http://www.pick.ucam.org/~ptc24/yvfc.html >> >> >> >> [Jeff] >> >>> Yuma Valley Agricultural Center? >>> Yaak Valley Forest Council? >> >> >> >> I went through the same process. My guess is "Yes, Very F'ing Clever." >> Peter? >> > > pri

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

2005-09-29 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > On Fri, 30 Sep 2005 00:16:02 +1000 > Steven D'Aprano wrote: > >>Say you have written a class, with a private variable. I decide that I >>need access to that variable, for reasons you never foresaw. > > What if the access to that variable was forbidden for reasons you ne

Re: Indexed variables

2005-09-22 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > So how do I define the function such as to discrimate wheter I call it by > f(a1) or f(a2) ? I don't want to sound rude, but I think you'll be better served by telling us why you would want to do such a thing - ten to one someone can suggest a better way to acomplish

Re: How to tell if an exception has been caught ( from inside the exception )?

2005-09-22 Thread Rocco Moretti
Paul Dale wrote: > > Hi everyone, > > I'm writing an exception that will open a trouble ticket for certain > events. Things like network failure. I thought I would like to have it > only open a ticket if the exception is not caught. Is there a way to do > this inside the Exception? As far as I

Re: Software bugs aren't inevitable

2005-09-14 Thread Rocco Moretti
Terry Reedy wrote: > But that, I admit, would be an invalid conclusion. And that, I claim, is > also invalid when 'iteration' and 'recursion' are reversed, no matter how > often repeated in texts and articles. The difference is between the > algorithms, not the differing syntactic expressions

Re: Removing duplicates from a list

2005-09-14 Thread Rocco Moretti
Rubinho wrote: > I can't imagine one being much faster than the other except in the case > of a huge list and mine's going to typically have less than 1000 > elements. To add to what others said, I'd imagine that the technique that's going to be fastest is going to depend not only on the lengt

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > On Tue, 06 Sep 2005 12:19:21 +0200 > Torsten Bronger wrote: > > >>"talin at acm dot org" <[EMAIL PROTECTED]> writes: >> >>>Anyway, here's an example, then, of how 'def' could be used: >>> >>>add = def( a, b ): >>> return a + b >> >>I'm really not an expert in function

Re: 'isa' keyword

2005-09-05 Thread Rocco Moretti
Colin J. Williams wrote: > Rocco Moretti wrote: > >> Terry Hancock wrote: >> >>> On Thursday 01 September 2005 07:28 am, Fuzzyman wrote: >>> >>>> What's the difference between this and ``isinstance`` ? >>> >>> I must confess t

Re: 'isa' keyword

2005-09-02 Thread Rocco Moretti
Terry Hancock wrote: > On Thursday 01 September 2005 07:28 am, Fuzzyman wrote: > >>What's the difference between this and ``isinstance`` ? > > I must confess that an "isa" operator sounds like it would > have been slightly nicer syntax than the isinstance() built-in > function. But not enough nic

Re: Well, Python is hard to learn...

2005-09-01 Thread Rocco Moretti
wen wrote: > due to the work reason, i have to learn python since last month. i have > spent 1 week on learning python tutorial and felt good. but i still don't > understand most part of sourcecode of PYMOL(http://pymol.sourceforge.net/) > as before. Well, last time I checked, a good chunk of PyMo

Re: OpenSource documentation problems

2005-09-01 Thread Rocco Moretti
Steve Holden wrote: > Every page of the docs links to "About this document", which contains > the following: """If you are able to provide suggested text, either to > replace existing incorrect or unclear material, or additional text to > supplement what's already available, we'd appreciate the

Re: Module Name Conflicts

2005-08-19 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > I have a java program in a package called 'cmd'. This of course > conflicts with the builtin python package of the same name. The thing > is, I need to be able to import from both of these packages in the same > script. I can import either one first, but any future attemp

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Rocco Moretti
Simon Brunning wrote: > On 8/15/05, Terry Hancock <[EMAIL PROTECTED]> wrote: > >>On Monday 15 August 2005 09:54 am, Simon Brunning wrote: >> >>>If you call its code, it's a library. If it calls yours, it's a framework. >> >>Such concision deserves applause. ;-) > > > Thank you. ;-) > > As other

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-15 Thread Rocco Moretti
Simon Brunning wrote: > On 8/15/05, Rocco Moretti <[EMAIL PROTECTED]> wrote: > >>Which lead me to the question - what's the difference between a library >>and a framework? > > > If you call its code, it's a library. If it calls yours, it's a fra

Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-15 Thread Rocco Moretti
Cameron Laird wrote: > Andy Smith rails against "frameworks": > http://an9.org/devdev/why_frameworks_suck?sxip-homesite=&checked=1 > Slapdash Summary: Libraries good, frameworks bad - they are a straightjackets and limit sharing. Which lead me to the question - what's the dif

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Christopher Subich wrote: > Rocco Moretti wrote: > >> Variables in Python are names. They aren't the cubbyholes into which >> you put values, they are sticky notes on the front of the cubby hole. > > > +1 MOTW (Metaphor of the Week) Thanks, but please note it&

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Dennis Lee Bieber wrote: > On Tue, 09 Aug 2005 10:39:29 -0500, Rocco Moretti > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>Change it to "the object referenced by y is assigned to the name of x", >>and you're closer to th

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Gregory Piñero wrote: > Ahh, so it's a mutable thing. That makes sense that I can't change a > mutable object and thus can't affect it outside of the function. If you meant "immutable" for the second mutable, you're right. > Does > that mean Python functions aren't always byref, but are someti

Re: Passing arguments to function - (The fundamentals are confusing me)

2005-08-09 Thread Rocco Moretti
Christopher Subich wrote: > Gregory Piñero wrote: > >> Hey guys, would someone mind giving me a quick rundown of how >> references work in Python when passing arguments into functions? The >> code below should highlight my specific confusion: This URL is always tossed out: http://starship.pytho

Re: Comparison of functions

2005-07-31 Thread Rocco Moretti
Adriano Varoli Piazza wrote: > As far as I recall from Math Analysis, which I studied two months ago, > you can't sort complex numbers. It makes no sense. The reason being > (reading from my book), it's not possible to define an order that > preserves the properties of arithmetical operations o

Re: On fighting fire with fire...

2005-07-29 Thread Rocco Moretti
Asad Habib wrote: > Well, even if you are a hobbyist, that does not excuse you from being > civil. After all, we are all humans beings that deserve to be treated with > respect. Professional, hobbyist, vagabond, ogre, instigator, troll ... > THERE IS NO EXCUSE ... please treat others with respect.

Re: On fighting fire with fire...

2005-07-28 Thread Rocco Moretti
Asad Habib wrote: > I agree with Mustafa. After all, we are a bunch of professionals and not > vagabonds hired to take pot shots at one another. Except that we're not all professionals. There are a large number of hobbyists who use Python and this list. At any rate, my suggestion was not to fors

Re: On fighting fire with fire...

2005-07-28 Thread Rocco Moretti
projecktzero wrote: > but..but...It's so much more fun to unleash your anger and fire back > with all guns blazing fanning the flame war that most discussion groups > degenerate into after a couple of responses. =) > > Actually, I had some self restraint yesterday. I wanted to write a > ripping re

Re: SciPy and NetCDF

2005-07-27 Thread Rocco Moretti
Scott Kilpatrick wrote: > So wherever pycdf does a: > > from Numeric import * > > what is the equivalent for SciPy? i.e. where is the full Numeric module > in SciPy? Python packages are in a pretty flat hierarchy. There really isn't a "SciPy Numeric" and a "pycdf Numeric" - Numeric, as an indep

Re: SciPy and NetCDF

2005-07-26 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > I am going to be doing a lot of work with large data sets stored in > various netCDF files, and after checking out the alternatives, I would > really like to go with SciPy. The problem is that SciPy offers no > native netCDF support. You may be having an issue because t

Re: goto

2005-07-21 Thread Rocco Moretti
> My "favorite" infinte loop with while is: > >i = 0 >while i < 20: > do_process(i) > > Note the prominent *lack* of any change to i here? > > Oh, for: > > from i = 0 > invariant 0 <= i <= 20 > variant 21 - i > until i > 19 > loop > do_process(i) >

Re: Documentation bug: Python console behaviour changed

2005-07-19 Thread Rocco Moretti
Tim Golden wrote: > Usually means you have a readline package installed: Should the readline package be twiddled to change the "quit" string in builtins to document the correct behavior? -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-19 Thread Rocco Moretti
Leif K-Brooks wrote: > rbt wrote: > >>IMO, most of the people who deride goto do so because they heard or read >>where someone else did. > > > 1 GOTO 17 > 2 mean,GOTO 5 > 3 couldGOTO 6 > 4 with GOTO 7 > 5 what GOTO 3 > 6 possibly GOTO 24 > 7 you!

Re: python certification

2005-07-18 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > i want to get a small certificate or diploma in python. > it should be online cuz i live in pakistan and wont have teast centers > near me. > it should be low cost as i am not rich. > and hopefully it would be something like a a begginer certification cuz > i am new to py

Re: all possible combinations

2005-07-14 Thread Rocco Moretti
rbt wrote: > Say I have a list that has 3 letters in it: > > ['a', 'b', 'c'] > > I want to print all the possible 4 digit combinations of those 3 > letters: When I have occasion to do an iteration of iterations, I either use recursion (already posted) or use an accumulator type loop: items = [

Re: Porting from Python 2.3 to 2.4

2005-07-14 Thread Rocco Moretti
Joseph Garvin wrote: > Anand wrote: > >> Hi >> >> Are there any tools that would help in porting code from >> Pyton 2.3 to 2.4 ? I have gone through the whatsnew documents >> and created a document comparing Python 2.4 to 2.3. But so far >> has not been able to find any tool that will signal cod

Re: Why does reply to messages on this list put the sender in the To

2005-07-12 Thread Rocco Moretti
Peter Decker wrote: > On 7/12/05, Dark Cowherd <[EMAIL PROTECTED]> wrote: > > >>Most lists when i hit reply it puts the list address back in the To >>address and some lists allow you to configure this. >> >>But in this list reply sends the mail back as a private mail and there >>seems to be no op

Re: How does this code works:

2005-07-11 Thread Rocco Moretti
vch wrote: > Here's an example from some book: > > def foo(n): > s = [n] > def bar(i): > s[0] += i > return s[0] > return bar > > what I don't understand is how this example works, taking into account > the LGB rule. I thought that s is not accessible from bar, but

Re: f*cking re module

2005-07-08 Thread Rocco Moretti
François Pinard wrote: > I once worked with a PL/I compiler (on a big IBM mainframe), which was > trying to be helpful by spitting pages of: > > Error SUCH AND SUCH, assuming that THIS AND THIS was meant. > > and continuing compilation nevertheless. It was a common joke to say > that PL/I w

Re: Python Module Exposure

2005-07-07 Thread Rocco Moretti
Robert Kern wrote: > Jacob Page wrote: > >> Does this newsgroup find attachments acceptable? > > No. Please put files somewhere on the web and post a URL. This would be > a good forum to informally announce and discuss your module. To add to what Robert said, keep in mind this newsgroup is als

Re: HELP!

2005-07-07 Thread Rocco Moretti
Ert Ert wrote: > Please help me i down loaded python nd itplays on MS-DOS mode and not on > normal please help Python itself is a command line program. "MS-DOS mode" *is* it's normal mode. As other's have mentioned, there are graphical front ends to Python which you may be more comforatble wit

Re: Lisp development with macros faster than Python development?..

2005-07-06 Thread Rocco Moretti
Raymond Hettinger wrote: > [EMAIL PROTECTED] wrote: > >>The problem is that questions like 'What lang is fastest to develop >>in?' >>are hard to answer definitively. > > > FWIW, Google's answer to that question is C++, Java, and Python. For > any given problem, any of the three are acceptable.

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-04 Thread Rocco Moretti
John Roth wrote: > "Peter Maas" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> George Sakkis schrieb: >> >>> Given that the latest 2.x python will be 2.9 >> >> >> Why not 2.13 or 2.4711? Version strings are sequences of arbitrary >> integers separated by dots and not decimal n

Re: Favorite non-python language trick?

2005-07-03 Thread Rocco Moretti
Jp Calderone wrote: > On Fri, 01 Jul 2005 15:02:10 -0500, Rocco Moretti > <[EMAIL PROTECTED]> wrote: > >> >> I'm not aware of a language that allows it, but recently I've found >> myself wanting the ability to transparently replace objects. >

Re: Assigning to None

2005-07-03 Thread Rocco Moretti
François Pinard wrote: > [Rocco Moretti] > > >>foo, bar, _ = gen_tuple(stuff) > > >>as '_' is already special cased (last result in interactive mode), and >>is already used for "don't care" sematics in Prolog. > > > `_&#x

Re: Favorite non-python language trick?

2005-07-01 Thread Rocco Moretti
Joseph Garvin wrote: > I'm curious -- what is everyone's favorite trick from a non-python > language? And -- why isn't it in Python? I'm not aware of a language that allows it, but recently I've found myself wanting the ability to transparently replace objects. For example, if you have a trans

  1   2   >