Re: How Compute # of Days between Two Dates?

2008-08-31 Thread Michael Tobis
from datetime import datetime # batteries included today = datetime.now() xmas = datetime(today.year,12,25) if (xmas - today).days > 1: print "%d days until Christmas" % (xmas - today).days else: print "Merry Christmas!" -- http://mail.python.org/mailman/listinfo/python-list

Re: precedence of [] vs .

2008-08-14 Thread Michael Tobis
On Aug 14, 6:01 pm, "Calvin Spealman" <[EMAIL PROTECTED]> wrote: > > attribute access (foo.bar) binds more tightly than subscripting (foo[bar]). That certainly looks right, and in retrospect I wonder that I even doubted it. But even the official docs seem to me to specify otherwise: http://docs.

precedence of [] vs .

2008-08-14 Thread Michael Tobis
I wrote some code to test the precedence of getitem vs getattr; it shows that getitem binds tighter. I have been handed some code that relies on the observed behavior. However, the Nutshell precedence list claims the opposite. Is the Nutshell wrong or am I missing something or is this a bug? clas

Re: internet searching program

2008-08-09 Thread Michael Tobis
I think you are talking about "screen scraping". Your program can get the html for the page, and search for an appropriate pattern. Look at the source for a YouTube view page and you will see a string var embedUrl = 'http:// You can write code to search for that in the html text.

Re: Calling external program from within python

2008-07-25 Thread Michael Tobis
These answers are too elaborate and abstract for the question. Emmanouil, Here is a program "myprog" which takes input and writes output to a file. It happens to be python but it could be anything. # #!/usr/bin/env python a = int(raw_input("enter thing 1 ")) b = int(raw_input("enter thing 2

Re: Not entirely serious: recursive lambda?

2008-07-22 Thread Michael Tobis
Thanks all! What a remarkable set of answers, intelligent, thought provoking and informative without exception. Of course, now I can't use Paul's version; it hardly counts as a japh if someone else wrote it! It is probably the closest to my original vision, alas. Miles' second suggestion was the o

Not entirely serious: recursive lambda?

2008-07-19 Thread Michael Tobis
I came across the "japh" concept today and decided to do one of my own, obviously, interpreting the 'p' somewhat loosely, http://en.wikipedia.org/wiki/JAPH but I'm not entirely satisfied with it: # japh, for certain values of 'p' f=lambda(r,N):N and f((" acdefijlmnopqrstuv"[N%19]+r,N/19))o

Re: Preferred method for "Assignment by value"

2008-04-15 Thread Michael Tobis
http://effbot.org/zone/python-objects.htm still says it best. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: Magic function

2008-01-11 Thread Michael Tobis
On Jan 11, 8:40 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Read the OP's post again. His (her?) users aren't expected to create the > toolkit, merely to use it. To create good toolkits you need both a master > programmer and an expert in the field. It is an advantage if th

Re: Magic function

2008-01-11 Thread Michael Tobis
On Jan 11, 6:15 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Your users are *scientists*, and you don't trust their intellectual > ability to learn a programming language as simple as Python? > > Instead of spending time and effort writing, debugging and maintaining > such a

Re: Research-oriented Python mailing list?

2007-11-22 Thread Michael Tobis
Perhaps what you are looking for is here: http://www.scipy.org/Mailing_Lists mt -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another indentation proposal

2007-08-20 Thread Michael Tobis
On Aug 19, 11:51 pm, James Stroud <[EMAIL PROTECTED]> wrote: > What's wrong with just saying the current indent level? I'd much rather > hear "indent 4" than "tab tab tab tab". Alternatively, you might also consider writing a simple pre and postprocessor so that you could read and write python th

Re: Newbie question

2007-08-19 Thread Michael Tobis
http://diveintopython.org/ mt -- http://mail.python.org/mailman/listinfo/python-list

Re: the one python book

2007-08-04 Thread Michael Tobis
On Aug 4, 9:32 am, Neil Cerutti <[EMAIL PROTECTED]> wrot > With Python, you won't find anything like that. Python is too > huge. That's silly. Python is small in the sense that C is small. The Python standard library is probably much bigger than the C standard library, but Kernghan and Richie don

Re: converting 64-bit fixed-point to float

2007-07-20 Thread Michael Tobis
It appears to be correct for positive numbers. if conval >= 2**16: conval -= 2**32 would appear to patch things up. It's not very pretty, though. You could at least start with input1 = [c_ushort(item) for item in input] instead of your first 9 lines. mt -- http://mail.python.org/mailman/

Re: CP4E revival

2007-05-24 Thread Michael Tobis
On May 24, 5:03 am, Richard Jones <[EMAIL PROTECTED]> wrote: > Michael Tobis wrote: > >http://tinyurl.com/yr62r3 > > > seems to short-circuit some pointless hoop-jumping to get you to the > > article. > > Hoop-jumping implemented to prevent just this kind of d

CP4E revival

2007-05-23 Thread Michael Tobis
Is education Python's killer app? I think it could be. I used the occasion of the Python Papers to motivate my efforts, and you can see what I came up with here on pages 8-15. The part that makes me especially queasy is the CP4E section on pages 10-11. I wish I had more to say there. It's fairly

Re: NOOOOB

2007-05-22 Thread Michael Tobis
Different strokes for different folks. You might get better advice about where to start if you tell us a bit about yourself. Do you have any other programming experience? Do you have specific goals in mind as a programmer? mt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie Suggestions

2007-05-15 Thread Michael Tobis
I think http://www.diveintopython.org/ would be very suitable for you. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: How to cleanly pause/stop a long running function?

2007-05-12 Thread Michael Tobis
> Doing a Ctrl+C > interrupt would be a not-so-clean-way of performing such a thing, and > it would quit the application altogether. I'd rather have the function > return a status object of what it has accomplished thus far. Just in case you are unaware that you can explicitly handle ^C in your py

Re: interesting exercise

2007-05-09 Thread Michael Tobis
On May 9, 2:41 pm, [EMAIL PROTECTED] wrote: > On May 9, 1:13 am, Charles Sanders <[EMAIL PROTECTED]> > wrote: > > or even this monstrosity ... > > > def permute2( s, n ): > >return [ ''.join([ s[int(i/len(s)**j)%len(s)] > > for j in range(n-1,-1,-1)]) > >for i in range(len(s)**n)

Re: interesting exercise

2007-05-08 Thread Michael Tobis
Thanks castironpi and alex, for this: def p(a,b): if not b: return [''] return [i+j for i in a for j in p(a,b-1)] That is a thing of beauty! As usual you guys didn't disappoint. (Validity check of alphabet removed; you didn't check for duplicate characters.) Here is the bloated

interesting exercise

2007-05-07 Thread Michael Tobis
I want a list of all ordered permutations of a given length of a set of tokens. Each token is a single character, and for convenience, they are passed as a string in ascending ASCII order. For example permute("abc",2) should return ["aa","ab","ac","ba","bb","bc","ca","cb","cc"] and permute("135

Re: New to Python - Easy way to open a text file

2007-03-30 Thread Michael Tobis
I think it's pretty clear that we aren't understanding what you mean by "open a text file and disply its content". I conclude that by "edna" you mean this thing: http://edna.sourceforge.net/ I suspect you are not asking a Python question at all. Did you try opening file:edna-0.6/templates/d

Re: Fortran vs Python - Newbie Question

2007-03-28 Thread Michael Tobis
I feel obligated to fan the flames a bit by pointing to http://www.fortranstatement.com/ a site which advocates discontinuing development of Fortran and does a good job of summarizing the problems with the contemporary development of that language. I am not convinced that a new high performance la

Re: Turn off line wrap for lists?

2007-01-04 Thread Michael Tobis
_ wrote: > (I did google for this, I promise) > > How do I get python NOT to insert newlines into string representations > of lists when I do something like this: > > strCollector += "%s" % (['a', 'list', 'with', 'lots', 'of', 'elements'] > * 100) It shouldn't and doesn't insert newlines. ##

Re: Python Programming Books?

2006-05-25 Thread Michael Tobis
I am not happy with any of the Python-as-a-First-Language books out there. My vague inclination to write one has not yet formed into a firm intention, but it's close. Of the books that are out there, Learning Python and Dive Into Python are best for the hobbyist as opposed to classroom setting, bu

Re: Quoting relevant material for response (was: Re: python vs perl lines of code)

2006-05-19 Thread Michael Tobis
OT, sort of, but... [EMAIL PROTECTED] wrote: >If that > quoting mechanism is available on the web interface and I haven't found > it - I'd love to know how to use it. Click "show options" and THEN hit "reply". It's a bit counterintuitive, but the entire message to which you reply is then shown.

Re: python vs perl lines of code

2006-05-18 Thread Michael Tobis
> According to your silly rule the shortest book on a subject would be the > best. Now why is that false? No, according to the rule, the shorter of two books **containing the same information** would be best. I don't think I'm a zealot. The original quote said "all else equal". Certainly legible

Re: python vs perl lines of code

2006-05-18 Thread Michael Tobis
John Bokma wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Ok I'm going to end with a flamebait - but I would posit, ALL OTHER > > THINGS BEING EQUAL - that a smaller number of characters and lines in > > code is more maintainable than larger number of characters and lines in > > the c

Re: python vs perl lines of code

2006-05-18 Thread Michael Tobis
Sorry, data about reports about X *is* data about X unless you believe the reports are uninfluenced by X. Like any proxy measure, it introduces noise and uncertainty, but it is still data. I can't imagine a motivation for Edward to make this up, so I accept his anecdotes as data. While it is poss

Re: python vs perl lines of code

2006-05-17 Thread Michael Tobis
"The plural of anecdote is not data." It's a pithy quote, but it isn't QOTW in my book, simply because it isn't true in general. Talk to some paleoclimatologists. There is no way to get uniform measures of ancient climate. What should we do then? Should we ignore the information we have? Are the

Re: a flattening operator?

2006-04-22 Thread Michael Tobis
I think by "regular expressions" you mean "expressions". "regular expressions" are what you get from "import re" . mt -- http://mail.python.org/mailman/listinfo/python-list

Re: proposed Python logo

2006-04-21 Thread Michael Tobis
A more Monty sort of Python logo would be fine with me. A flying sheep perhaps? An exploding penguin? A giant hedgehog? A dog license with the word "dog" crossed out and "cat" written in crayon? A great big book on how to put your budgie down? This http://www.informatik.uni-trier.de/~roth/bilder/m

Re: Pythonesque interface.

2006-04-21 Thread Michael Tobis
www.pygame.org Yes but he obviously wants this to be delivered to the browser. (Also the site is broken today... ) This comes up a lot, but I don't think there's an answer to it as yet. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: proposed Python logo

2006-04-21 Thread Michael Tobis
> Not that I'm disagreeing, but how to you rate "resonance with the product"? Hmm, I'm not a marketing professional, but this is would I would do with my focus groups: Ask people familar with the product to name what they like about the image, and what they like about the product, and look for an

Re: proposed Python logo

2006-04-21 Thread Michael Tobis
> Sorry dude, but it looks like a hairdryer! I'm afraid you have a point :-/ . > I think that the current logo is fine. Much more professional than the old > image. Yes, it is a MUCH more professional rendering than the old image, and it leaves a MUCH better first impression of the homepage. T

Re: proposed Python logo

2006-04-21 Thread Michael Tobis
Don't you think the Python Boys ought to have something to say about it? Eric Idle is going to be at my favorite Borders bookstore in half an hour. Should I go ask him? (I'm not going to do that; it's just an odd coincidence from my point of view.) I think there are trademark issues similar to th

Re: what has python added to programming languages? (lets be esoteric, shall we ; )

2006-04-21 Thread Michael Tobis
Although somewhat more elegant, Python slices follow Matlab's slice notation. In simpler cases they are identical. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: proposed Python logo

2006-04-21 Thread Michael Tobis
> Too rigid-looking somehow. Hey, I'm an amateur... There are lots of variations on the concept I can think of. I want someone with a lot of design talent *and a little familiarity with the language* to take enough interest to have a go at it. At least (unlike the tadpoles) it has some resonanc

Re: Looking for a programming resource for newbees

2006-04-20 Thread Michael Tobis
You may be interested in Programming Patterns in Python: http://www.amazon.com/gp/product/0130409561/103-9277940-9267015?v=glance&n=283155 It's out of print but Amazon has some; not everyone likes it but I think it tries to do what you are asking for. mt -- http://mail.python.org/mailman/listi

proposed Python logo

2006-04-20 Thread Michael Tobis
"Is this the right room for an argument?" http://geosci.uchicago.edu/~tobis/snake.png ok, so my execution is pretty crude, but you can at least see my idea. I trust you to imagine it professionally executed in cheerful colors. Advantages of proposed logo over existing logo --

Re: Calling Python from Matlab

2006-04-15 Thread Michael Tobis
I'm afraid I can't be very helpful to you, but you could be most helpful to some of us. Can you elaborate on what specifically you found difficult? In some circles Python is regarded as a direct competitor to Matlab. Your preference for Python for "other things than standard mathematical work" in

iPython and doctest

2006-04-12 Thread Michael Tobis
It appears that doctest does not work straightforwardly within iPython. I would like to be able to use doctest within a file conditionally, so that I can develop it within ipython and test it otherwise. It would seem that this would work: Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 200303

iPython and doctest

2006-04-12 Thread Michael Tobis
It appears that doctest does not work straightforwardly within iPython. I would like to be able to use doctest within a file conditionally, so that I can develop it within ipython and test it otherwise. It would seem that this would work: Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 200303

Re: More pythonic circle?

2006-04-08 Thread Michael Tobis
Proving yet again that it's possible to write Fortran in any language. You aren't getting any benefit from numpy or python here. Are you aiming for speed or legibility? Also, with this code, you are using radius for the dimensions of the enclosing box, as well as the radius of the circle, so it'

Re: programming puzzles?

2006-04-08 Thread Michael Tobis
Yeah, this was *much* easier than I expected. My candidate was in second place according to /usr/share/dict/words which has ixodid but not dioxid; I'm really not confident that dioxid is a word. I recall that I had also found the third place word now that I look at it. What I had to do was print

Re: programming puzzles?

2006-04-08 Thread Michael Tobis
Yeah, this was *much* easier than I expected. My candidate was in second place according to /usr/share/dict/words which has ixodid but not dioxid; I'm really not confident that dioxid is a word. I recall that I had also found the third place word now that I look at it. What I had to do was print

Re: programming puzzles?

2006-04-08 Thread Michael Tobis
The first piece of code that I ever voluntarily wrote was intended to solve this puzzle: Assign the number 2 to 'a', 3 to 'b' ... 27 to 'z'. To each word assign the value of the product of its characters. Find the English (or language of your choice) word whose product is closest to a million (or

Re: Seems like I want a pre-processor, but...

2006-03-29 Thread Michael Tobis
Well, Bill Mill and I simultaneously and independently decided to write a preprocessor to strip out the unfortunate "@" decorator syntax. I think we were both aiming at a polemic purpose rather than a practical one, but as time fades it seems less clear what we were simultaneously inspired to achie

Re: Try Python!

2006-03-29 Thread Michael Tobis
We had some discussion of this in the edu-sig meeting at PyCon. I alleged that I had read that there is no such thing as a Python sandbox. Others claimed that one could simply preprocess and disallow "dangerous" constructs. My allegation was based on an argument from authority; I recalled reading

Re: Remove integer from float number

2006-03-24 Thread Michael Tobis
I think you ought to make your own class and define some of the special methods. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: a problem to solve

2006-03-24 Thread Michael Tobis
Yeah, I misread the question, but the gist of my query remains. > The odds are 100% if there is at least one solution. Let's not get too philosophical. My question was whether there was an a priori reason for believing that there is a solution. > You want permutations with replacement, so there

Re: a problem to solve

2006-03-24 Thread Michael Tobis
First do a little estimation. We know we have to find four out of 16 switches, so the number of possibilities to search is only C(4,16) = 1820, so an exhaustive search will work. These will turn on 15 lights in each set of 20, of which the number of possibilities is C(15,20)**4 = 57779667567968256

Re: import random module

2006-03-22 Thread Michael Tobis
Wow. Six simultaneous responses! Python rocks! Anyway, I actually tried it, and persisted through the secondary confusion about the lurking .pyc file, so even though I'm in sixth place I get points for completeness... mt -- http://mail.python.org/mailman/listinfo/python-list

Re: import random module

2006-03-22 Thread Michael Tobis
1) remove the file random.pyc in your working directory 2) rename the file random.py to something else and run it. The import mechanism is looking for random.pyc or random.py, but you have already named your file that! Your current directory is above your library directory in python's search path

Re: - Python Newcomer Starting with Coding

2006-03-21 Thread Michael Tobis
Are you sure this is what you want to do? It seems an odd objective for a preliminary effort. Forgive me if I am reading this wrong, but I am concerned that you think you need to do all this work to use the package. If so, you are asking the wrong questions. Please look into the PYTHONPATH environ

Re: New-style Python icons

2006-03-20 Thread Michael Tobis
OK, but Python IS clever, so its logo ought to be too. Since you are acknowledging they are tadpoles, I guess you've heard my gripes... mt -- http://mail.python.org/mailman/listinfo/python-list

Re: New-style Python icons

2006-03-20 Thread Michael Tobis
I think this is great work but imagine what you could do with a real logo! Besides the pleasant colors what do you like about it? I have in mind something with a coil motif but I can't execute it worth a damn. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: can't rebind magic methods

2006-03-20 Thread Michael Tobis
Still a bit confused actually. Any explanation of the following? mt def getf(method,name): def f(self, *a, **k): return method(self.val, *a, **k) f.func_name = name return f class myint(object): def __init__(self, val): self.val = int(val) for spec in 'str repr has

Re: can't rebind magic methods

2006-03-20 Thread Michael Tobis
Thanks! Only a minor correction: the last line should be _setdelegate(myint, int,'__%s__' % spec) The business with f.func_name struck me as unnecessary, but I was quite wrong. This was an interesting exercise for me. Thanks. Michael -- http://mail.python.org/mailman/listinfo/python-list

can't rebind magic methods

2006-03-18 Thread Michael Tobis
I'd appreciate an explanation of why this doesn't work and any workarounds. It's not a showstopper, but I'd like to pseudo-inherit a bunch of magic methods from an attribute, and would prefer to abstract the definitions into a loop rather than write them all out. thanks mt ### import ne

Re: Printable string for 'self'

2006-03-17 Thread Michael Tobis
> What were you planning to do with this object exactly that didn't involve > binding it to any other names during its lifetime? Nothing so silly as that. The idea is not to prevent other references from binding to the object, but to allow the object to ensure that a certain symbol always points

Re: Printable string for 'self'

2006-03-15 Thread Michael Tobis
This behavior seems to be commonly wanted by people discovering Python, and it is the rare case of something one can imagine that is really a stretch to achieve in Python. Because more or less than one name may refer to an object, in general an object can't know its name. You can get part of the w

Re: Newbie Class/Counter question

2006-03-14 Thread Michael Tobis
Paul, thanks for the enlightening intro to pyparsing! We don't really know what the application is (I suspect it's homework), but whether it's homework or a real-world one-off this all seems like overkill to me. There's a time for elegance and a time for quick and dirty. Assuming line oriented inp

Re: New python.org site

2006-03-11 Thread Michael Tobis
I think a logo contest is a good idea, and I am already working on my entry. I could also imagine a stylesheet contest. The issue is who does the judging and what are the criteria. Steve, what you say is true. Possibly people who are experienced in making a six page site for their aunt's caterin

Re: Cheese Shop -> BSOL?

2006-03-11 Thread Michael Tobis
I like cheeseshop just fine, but have been a Monty Python fan since they appeared on the CBC in, I think, 1969. I'm one of those people who is always surprised when a MP bon mot is greeted with confusion and the suspicion that I have finally lost my mind altogether. So... If we are moving to the s

Re: Python Evangelism

2006-03-10 Thread Michael Tobis
The name isn't changing, so it's a "make lemonade" situation. What's the best use we can make of the name; how do we make it stick in people's minds positively? How do we make a positive image out of it? Shy tadpoles, by the way, ( http://python.org/images/python-logo.gif ) isn't it. mt -- ht

Re: Python advocacy in scientific computation

2006-03-08 Thread Michael Tobis
I think I agree with Steve here. I suspect you should either have sufficiently trained your users in Python, or have limited them to one-line statements which you could then strip of leading whitespace before passing them to Python, or even offered the alternative of one or the other. This would n

Re: New python.org website

2006-03-08 Thread Michael Tobis
> No one > of the complainers and negativists do claim that they could do it much > better. Indeed, I do not have to be able to write a particular program to notice it has bugs. On the other hand, (since I think the design, while not brilliant, is good) fixing the logo is something that can be ac

Re: New python.org website

2006-03-07 Thread Michael Tobis
While the new one is much better than the old website, the logo strikes me as awful. I tried to suggest repurposing the much better PyCon logo, but it didn't raise the vast groundswell of support I wanted it to. But for whatever its worth I'll try again. My rant is here: http://tinyurl.com/rkq3s

Re: Python advocacy in scientific computation

2006-03-07 Thread Michael Tobis
> Indentation > makes all kinds of inlined code extremely clumsy or practically impossible > in Python. This is the only sensible argument against the indentation thing I've heard. Python squirms about being inlined in a presentation template. Making a direct competitor to PHP in pure Python is pr

Re: Python advocacy in scientific computation

2006-03-06 Thread Michael Tobis
> I have met no problems using F90 together with f2py Thank you for the correction. I should have qualified my statement. Our group must cope with F90 derived types to wrap a library that we need. f2py fails to handle this case. While the f2py site alleges that someone is working on this, I conta

Re: Python advocacy in scientific computation

2006-03-05 Thread Michael Tobis
1) indentation: I claim that this is a trivial matter. Indentation is enforced, but if you want to end all your blocks with #end, feel free. Or write a preprocessor to go from your preferred block style to python's 2) self.something tedious to look at. Again, you can somewhat work around this i

Re: Python advocacy in scientific computation

2006-03-05 Thread Michael Tobis
> $ rm `find . -name "*.pyc"` Ouch. Is that a true story? While we're remeniscing about bad typos and DEC, I should tell the story about the guy who clobberred his work because his English wasn't very strong. Under RT-11, all file management was handled by a program called PIP. For example to

Re: Python advocacy in scientific computation

2006-03-04 Thread Michael Tobis
ou know everything you need to know, and I strongly recommend you reconsider this attitude. For one thing, you misjudged which side of the divide I started on. Michael Tobis (While I dislike credentialism on usenet, I will reply in kind. I hold a Ph.D. in geophysical fluid dynamics.) -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2006-03-01 Thread Michael Tobis
I think the answers so far are unnecessarily confusing and off the mark. Here is what I think you think you want to know: 1) import only works once. If you try import again, it will see the module already exists, and will ignore you 2) the functionality you think you want is reload. >>> reload m

Python advocacy in scientific computation

2006-02-14 Thread Michael Tobis
Someone asked me to write a brief essay regarding the value-add proposition for Python in the Fortran community. Slightly modified to remove a few climatology-related specifics, here it is. I would welcome comments and corrections, and would be happy to contribute some version of this to the Pytho

Re: Is python very slow compared to C

2006-02-12 Thread Michael Tobis
> Read his post again. He didn't ask a specific question at all, and he > certainly didn't mention execution speed. agreed > He asked a vague, meaningless question about whether Python was "slow > compared to C". No, that is both wrong and gratuitously harsh. He had heard vague meaningless com

Re: Is python very slow compared to C

2006-02-11 Thread Michael Tobis
Experienced programmers learning Python should read this: http://effbot.org/zone/python-objects.htm Try to understand the advantages of this approach, and understand its costs. Essentially, everything you do in Python (or related languages) involves resolving a name. Sometimes the number of dict

Re: VB to Python migration

2006-02-02 Thread Michael Tobis
An incremental approach and a redesign are not the same thing. It might be insurmountably difficult to acheeve both in a move to another platform. mt -- http://mail.python.org/mailman/listinfo/python-list

Re: beta.python.org content

2006-01-27 Thread Michael Tobis
What about some permutation of the PyCon logo? It is really quite brilliant. Solves many problems: dynamic, doesn't just sit there, looks like it is moving toward a goal direction of motion surprising and memorable refers to software in the minds of experienced coders takes advanta

Re: beta.python.org content

2006-01-26 Thread Michael Tobis
I like the design, though I'd prefer stronger colors. I think it would be a major improvement except for the logo. I agree with others that the logo is a serious disappointment. Although the symmetry has some initial appeal, I do not see or want to see a two-ness about Python, and I find it distur

Re: beta.python.org content

2006-01-26 Thread Michael Tobis
newer success stories please... mt -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-20 Thread Michael Tobis
Clearly the Ruby/Rails folks are making an effort to place themselves as an easy-to-learn first language for people who might otherwise drift into the rather awkward template-first way of thinking that is PHP. I note that the Rails people are closely affiliated with the 37signals people who in tur

Re: assignment to reference

2005-10-26 Thread Michael Tobis
I apparently don't understand this question in the same way the way others do. I think the question is about the mutability of strings. To my understanding of your question, it is impossible, at least if the referenced objects are strings or other objects of immutable type. 'cabbage' cannot be c

Re: Hi All - Newby

2005-10-25 Thread Michael Tobis
> confusion regarding some of the basics... Reset your brain. This came up recently, and despite there being a pending quibble, I think it's extremely useful to the experienced programmer/new Pythonista: http://effbot.org/zone/python-objects.htm And since Frederik is apparenlty reading this thr

PyNSol: Objects as Scaffolding

2005-07-06 Thread Michael Tobis
bout a software project as it is an article using that project to present an alternative way of thinking about how object oriented programming (and Python!) can relate to high performance simulations. I welcome comments. mt -- Michael Tobis Geophysical Sciences University of Chicago -- http://mail.pyt

Re: declarations summary

2005-02-07 Thread Michael Tobis
Well, many scientists and engineers don't have the time, motivation or ability to master the intricacies of recent fortran vintages either. That's the problem. Very large codes written by teams of software engineers for well-delimited application spaces will continue to be written in some version

Re: declarations summary

2005-02-07 Thread Michael Tobis
Alex Martelli wrote: > Michael Tobis <[EMAIL PROTECTED]> wrote: >... > > .x = 1 > > .def foo(): > > . if False: > > . global x > > . x = 2 > > .foo() > > .print x > > > > prints "1" > > Wrong: > &

declarations summary

2005-02-06 Thread Michael Tobis
Summary of my understanding of a recent interesting thread: General usage has "declaration" meaning "statement which does not generate executable bytecode but merely affects the compiler". My assertion that decorator syntax is "declarative" is therefore formally false. The common assertion that "

Re: variable declaration

2005-02-01 Thread Michael Tobis
> All in all, I fail to see what gains would be expected by making Python > into a single-assignment or single-binding language, even on a module by > module basis, to repay this kind of awkwardness. Just to be clear, if anyone was suggesting that, it wasn't me. It would be helpful on occasion in

Re: pythonic equivalent of Mathematica's FixedPoint function

2005-02-01 Thread Michael Tobis
We apologise for the previous apology. http://arago4.tn.utwente.nl/stonedead/albums-cds/sketches/another-monty-python-record/apologies.html -- mt -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-02-01 Thread Michael Tobis
> How common is it for a local variable to be bound in > more than one place within a function? It's more natural for a beginner to read or write .mystr = "" .for snippet in snippets: . if ilike(snippet): . mystr = mystr + snippet than .mylist = [] .for snippet in snippets: . if ilike(

Re: variable declaration

2005-02-01 Thread Michael Tobis
Given the behavior, the documentation is gratifyingly correct. Given that the syntax is legal, though, the behavior is not what one would intuitively expect, and is therefore unPythonic by (rather dramatically) violating the principle of least surprise. It's also, to me, understandable why it's d

Re: variable declaration

2005-01-31 Thread Michael Tobis
Alex Martelli wrote: > Michael Tobis <[EMAIL PROTECTED]> wrote: > he can perfectly > well correct his misexpression if he cares to -- not my job to try to > read his mind and perform exegesis on his words. Well, I hate to try to tell you your job, but it doesn't seem to

Re: variable declaration

2005-01-31 Thread Michael Tobis
This is definitely a wart: ... z = 42.3 ... ... def f(): ...if False: ... global z ...z = -666 ... ... f() ... print z -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-01-31 Thread Michael Tobis
> that's a nice theory, but since the decorator line is executed by the inter- > preter, it's a little weak. Well, uh, who else would process it? "use strict' and 'my epsilon' in perl are executed by the perl interpreter as well, but they have a declarative flavor. A decorator is a modifier to a

Re: variable declaration

2005-01-31 Thread Michael Tobis
With all due respect, I think "so go away if you don't like it" is excessive, and "so go away if you don't like it and you obviously don't like it so definitely go away" is more so. The writer is obviously neither a native speaker of English nor an accomplished user of Python, so there are two lang

Re: Fortran pros and cons (was Re: Coding style article with interesting section on white space)

2005-01-30 Thread Michael Tobis
[EMAIL PROTECTED] wrote: > Michael Tobis wrote: > Fortran 90/95 is more expressive than Fortran 77 in many ways, as > described in ... > http://www.nr.com/CiP97.pdf . > > ... expresses more science per > line of code and per programming workday. The example shown on p 10

  1   2   >