Re: Create object name from string value?

2010-01-21 Thread Alf P. Steinbach
or dictionary. I don't understand how you intend to use a variable whose name comes from dynamic data. So I agree with Steven that it's the wrong way to handle the problem -- whatever the problem is! But, if it can help: >>> import __main__ >>

Re: Symbols as parameters?

2010-01-21 Thread Alf P. Steinbach
* Carl Banks: On Jan 21, 2:38 am, "Alf P. Steinbach" wrote: * Carl Banks: On Jan 20, 11:43 pm, Martin Drautzburg [snip] What I am really looking for is a way - to be able to call move(up) - having the "up" symbol only in the context of the function c

Re: Symbols as parameters?

2010-01-21 Thread Alf P. Steinbach
* Diez B. Roggisch: Am 21.01.10 12:58, schrieb Alf P. Steinbach: * Stefan Behnel: Alf P. Steinbach, 21.01.2010 11:38: * Carl Banks: On Jan 20, 11:43 pm, Martin Drautzburg [snip] What I am really looking for is a way - to be able to call move(up) - having the "up" symbol o

Re: Symbols as parameters?

2010-01-21 Thread Alf P. Steinbach
* Diez B. Roggisch: Am 21.01.10 19:48, schrieb Alf P. Steinbach: * Diez B. Roggisch: Am 21.01.10 12:58, schrieb Alf P. Steinbach: * Stefan Behnel: Alf P. Steinbach, 21.01.2010 11:38: * Carl Banks: On Jan 20, 11:43 pm, Martin Drautzburg [snip] What I am really looking for is a way - to

Re: Symbols as parameters?

2010-01-21 Thread Alf P. Steinbach
* Diez B. Roggisch: Am 21.01.10 20:01, schrieb Alf P. Steinbach: * Diez B. Roggisch: Am 21.01.10 19:48, schrieb Alf P. Steinbach: * Diez B. Roggisch: Am 21.01.10 12:58, schrieb Alf P. Steinbach: * Stefan Behnel: Alf P. Steinbach, 21.01.2010 11:38: * Carl Banks: On Jan 20, 11:43 pm

Re: Symbols as parameters?

2010-01-21 Thread Alf P. Steinbach
* Carl Banks: On Jan 21, 10:46 am, "Alf P. Steinbach" wrote: * Carl Banks: On Jan 21, 2:38 am, "Alf P. Steinbach" wrote: * Carl Banks: On Jan 20, 11:43 pm, Martin Drautzburg [snip] What I am really looking for is a way - to be able to call move(up)

Re: Rounding up to the next 100

2010-01-21 Thread Alf P. Steinbach
digits (default 0 digits). This returns an int when called with one argument, otherwise the same type as the number. ndigits may be negative. >>> _ Might be useful to know regarding "get rid of the decimal point": in 3.x round(x) does that, in 2.x it doesn't. Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Rounding up to the next 100

2010-01-21 Thread Alf P. Steinbach
Which avoids the math.ceil but assumes the number is positive (or zero). Cheers & hth., - Alf PS: Note that this trick doesn't work with most other common languages that I'm familiar with, since the round towards zero instead of down to minus infinity, but Python has more clean seman

Re: Symbols as parameters?

2010-01-21 Thread Alf P. Steinbach
ed, quoted above. The best technique in my view is what you came up with yourself in the article I'm responding to (but snipped by me), namely a class with the constants and the function. It doesn't do what you required originally. But it's much better! :-) Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Symbols as parameters?

2010-01-22 Thread Alf P. Steinbach
* Stefan Behnel: Alf P. Steinbach, 21.01.2010 20:24: Do you understand how bad that makes you look? I think the right thing to say at this point is "don't feed the troll". I find it amazing that you continue this kind of ad hominem attack. You leave it open who you regard a

Re: Symbols as parameters?

2010-01-22 Thread Alf P. Steinbach
n't give up one humanity just because of one group where that happens regularly. I'm sort of counting on you to prove that there are, counting myself and one other, and perhaps now you, at least three persons here who are happy for technical corrections from me. Or, perhaps there's some aspect of locals(), e.g. in the context of decorators, that I don't know about and can now learn. :-) Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Symbols as parameters?

2010-01-22 Thread Alf P. Steinbach
* Steven D'Aprano -> Alf P. Steinbach: No, you got it spot on. Not to discourage you, but you're at least the third person who pointed this out in this thread. I get the impression that there's some message traffic that I don't see, perhaps on the mailing list, s

Re: Symbols as parameters?

2010-01-22 Thread Alf P. Steinbach
d in some way. Unfortunately my idea, fixing up the class' __dict__ in the metaclass, didn't work because the metaclass __new__ turned out to be called after, not before. (Since Python can't guarantee that modifications to locals() will take, I wonder whether it would be bette

Re: Symbols as parameters?

2010-01-22 Thread Alf P. Steinbach
* Wolfgang Rohdewald: On Friday 22 January 2010, Alf P. Steinbach wrote: I get the impression that there's some message traffic that I don't see For example, the recent thread "Covert number into string" started with a reply in my newreader, using EternalSeptember&#

Re: maintain 2 versions of python on my computer

2010-01-22 Thread Alf P. Steinbach
- expands %I to a full path name with short names only %~dp$PATH:I - searches the directories listed in the PATH %~ftzaI - expands %I to a DIR like output line values. The %~ syntax is terminated by a valid FOR variable name. C:\test> _ Cheers & hth. (even if a bit of

Re: list.pop(0) vs. collections.dequeue

2010-01-22 Thread Alf P. Steinbach
d, it incurs a memory overhead -- not the one directly from the pop optimization, but by the requirements of buffer extension. Essentially, as discussed above, it would then have to use a doubling buffer. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: list.pop(0) vs. collections.dequeue

2010-01-23 Thread Alf P. Steinbach
t time without risking an accumulation of unused memory, a memory leak, although it can be amortized constant time, at the cost of wasting some percentage of memory. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: list.pop(0) vs. collections.dequeue

2010-01-23 Thread Alf P. Steinbach
* Steve Howell: On Jan 23, 12:32 am, "Alf P. Steinbach" wrote: * Steve Howell: On Jan 23, 12:13 am, Terry Reedy wrote: Challenge yes, mock no. Part of writing good basic data structures is not adding needless complication from featuritis and not penalizing 99.99% of access to sa

Re: iterating lists

2010-01-23 Thread Alf P. Steinbach
ot; as expected for w in l3: print( w, l3 ) print(l3.pop()) #prints "lift off" - inconsistent to first case... If the list has at least one item you always get into the first iteration of the loop. I.e. there's no inconsistency, unless you count the lack of an exception as an inconsistency. I don't know whether the behavior is clearly defined or not; there is a possibility that it might be well-defined. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: list.pop(0) vs. collections.dequeue

2010-01-23 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 23 Jan 2010 09:57:04 -0500, Roy Smith wrote: In article , "Alf P. Steinbach" wrote: But it would IMHO have been better if it wasn't called "list", which brings in the wrong associations for someone used to other languages. +1. Whe

Re: this customize sort did not work ,what's wrong?

2010-01-23 Thread Alf P. Steinbach
t l def sort_by_list(E1, E2): print len(E1), len(E2) return len(list(E1)) > len(list(E2)) l.sort(cmp=sort_by_list) print l output: [[1, 2, 3, 4], [1, 2], [1, 2, 3, 4, 5]] 2 4 5 2 [[1, 2, 3, 4], [1, 2], [1, 2, 3, 4, 5]] the order of the elements in the list did not change!

Re: ISO module for binomial coefficients, etc.

2010-01-24 Thread Alf P. Steinbach
27;d check out the gamma function, which matches factorial for integer arguments (plus or minus 1). Or, e.g., logarithms... ;-) Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Alf P. Steinbach
tions for the most concise reference sheet for python 3 that exists? being able to print off the entire language spec on two or four pages and tacking it up in front of me would be just ducky. thanks. Sorry, don't know. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: how to list the attributes of a class, not an object?

2010-01-24 Thread Alf P. Steinbach
* Robert P. J. Day: On Sun, 24 Jan 2010, Alf P. Steinbach wrote: * Robert P. J. Day: once again, probably a trivial question but i googled and didn't get an obvious solution. how to list the attributes of a *class*? eg., i was playing with dicts and noticed that the type returned b

Re: Symbols as parameters?

2010-01-24 Thread Alf P. Steinbach
* Gabriel Genellina: En Fri, 22 Jan 2010 10:16:50 -0300, Alf P. Steinbach escribió: I get the impression that there's some message traffic that I don't see, perhaps on the mailing list, since (a) I haven't seen that about 'locals' pointed out by anyone else in this

Re: Symbols as parameters?

2010-01-24 Thread Alf P. Steinbach
quot;locals.py", line 29, in test() File "locals.py", line 27, in test down NameError: global name 'down' is not defined Cheers & hth., - Alf * George Sakkis: On Jan 22, 8:39 pm, Martin Drautzburg wrote: Martin Drautzburg wrote: with scope(): #

Re: [Edu-sig] some turtle questions

2010-01-24 Thread Alf P. Steinbach
e: since I'm not on the original list, could you perhaps forward to that list or to the original poster? Thanks, - Alf As for putting a limit on a turtle's travel, you need to write an appropriate conditional. For example, if you want your turtle to stay within a 200x200 squ

Re: start .pyo files with doubleclick on windows

2010-01-24 Thread Alf P. Steinbach
n.compiledfile python.compiledfile="C:\Program Files\cpython\python31\python.exe" "%1" %* C:\> _ Use ftype to change the association. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError not caught by except statement

2010-01-25 Thread Alf P. Steinbach
ne 306, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Is this a complete listing? CHheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Total maximal size of data

2010-01-25 Thread Alf P. Steinbach
eers & hth., - Alf (by what mechanism do socks disappear from the washer?) -- http://mail.python.org/mailman/listinfo/python-list

Re: list.pop(0) vs. collections.dequeue

2010-01-25 Thread Alf P. Steinbach
as too much knowledge. Is the tutorial regarded as part of the language specification? I understand that the standard library docs are part (e.g. 'object' is only described there), and that at least some PEPs are. Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing the name of an actual parameter

2010-01-26 Thread Alf P. Steinbach
way that you invoke the routine. For example, >>> def f( **kwa ): ... print( kwa ) ... >>> a = 1234 >>> b = "huh" >>> f( a = a, b = b ) {'a': 1234, 'b': 'huh'} >>> _ Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from array.array

2010-01-26 Thread Alf P. Steinbach
Array( array.array ): def __new__( self, *args ): return array.array.__new__( self, "B" ) def __init__( self, a, b ): array.array.__init__( self ) self.a = a self.b = b a = ByteArray( 4, 5 ) print( a ) print( a.a ) Disclaimer: I'm not a Python programmer. :-) Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from array.array

2010-01-26 Thread Alf P. Steinbach
* Alf P. Steinbach: * Torsten Mohr: Hello, i try to derive a class from array.array: import array class Abc(array.array): def __init__(self, a, b): array.array.__init__(self, 'B') self.a = a self.b = b a = Abc(4, 5) print a print a.a I get an er

Re: deriving from array.array

2010-01-26 Thread Alf P. Steinbach
rited from 'object', it takes no args (except the self arg). Is there a way to find out what i need to call? Testing. :-) I haven't found much in the documentation. From writing C extensions i knew about the "new" entry in the PyTypeObject struct but it seems there's

Re: python 3's adoption

2010-01-26 Thread Alf P. Steinbach
uch as limited range integers. Well, perhaps floating point, but... * Much more integrated unicode support, rewrite of most its text or string semantics. Fantastic. Finally. I'm not sure if the Unicode support is fantastic. I have the impression that there are still some edges to

Re: python 3's adoption

2010-01-26 Thread Alf P. Steinbach
* alex23: "Alf P. Steinbach" wrote: Actually not, IMHO. All it does is is to provide incompatibility. They forgot Ronald Reagan's old maxim: if it don't need fixin', don't fix it. [...] Probably there must have been some rationale, but to put it bluntly removi

Re: python 3's adoption

2010-01-26 Thread Alf P. Steinbach
* Steve Holden: [Off-list] alex23 wrote: "Alf P. Steinbach" wrote: Actually not, IMHO. All it does is is to provide incompatibility. They forgot Ronald Reagan's old maxim: if it don't need fixin', don't fix it. [...] Probably there must have been some ra

Re: python 3's adoption

2010-01-26 Thread Alf P. Steinbach
* John Bokma: "Alf P. Steinbach" writes: Please don't post more noise and ad hominem attacks to the group, Steve. Funny that you talk about noise while replying yourself to noise. Xah Lee is just a pathetic spammer. He's not going to reply in this thread. He just shits

Re: Just drawing lines and plotting points?

2010-01-26 Thread Alf P. Steinbach
nloop() He he, it's even easier to draw a graph using the turtle module. Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Just drawing lines and plotting points?

2010-01-27 Thread Alf P. Steinbach
* rantingrick: On Jan 26, 10:52 pm, "Alf P. Steinbach" wrote: * rantingrick: On Jan 26, 9:38 pm, Terry Reedy wrote: On 1/26/2010 7:54 PM, Chris Rebert wrote: On Tue, Jan 26, 2010 at 4:36 PM, Someone Something wrote: Hello, I need a python library that makes drawing

Re: python 3's adoption

2010-01-27 Thread Alf P. Steinbach
but also the semantics have changed: >>> import sys >>> sys.version '2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]' >>> >>> print( "2+2 =", 2+2 ) ('2+2 =', 4) >>> _ >>> import sys &g

Re: python 3's adoption

2010-01-27 Thread Alf P. Steinbach
lid, it doesn't give you any shred of compatibility for this. A code rewrite can be partially automated like 2to3 but the incompatibility needlessly introduces an additional set of things that Can Go Wrong(TM), and with Murphy present, as He always is, well. So again, what sort of an incompatibility are you talking about concerning 'print' between 2.6 and 3.x? Syntax and semantics. They're different. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3's adoption

2010-01-27 Thread Alf P. Steinbach
. :-) However, the root node of this subthread was my statement about the needless incompatibility introduced by changing print in 3.x, whether that statement was correct or reasonable / whatever. The main problem with the incompatibility is for porting code, not for writing code from scratch. It's also a problem wrt. learning the language. And I see no good reason for it: print can't really do more, or less, or more conveniently (rather, one has to write a bit more now for same effect). Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3's adoption

2010-01-27 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: [...] The main problem with the incompatibility is for porting code, not for writing code from scratch. It's also a problem wrt. learning the language. And I see no good reason for it: print can't really do more, or less, or more conveniently (r

Re: python 3's adoption

2010-01-27 Thread Alf P. Steinbach
* Adam Tauno Williams: On Wed, 2010-01-27 at 18:52 +0100, Alf P. Steinbach wrote: * Steve Holden: Alf P. Steinbach wrote: [...] The main problem with the incompatibility is for porting code, not for writing code from scratch. It's also a problem wrt. learning the language. And I see no

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
* Steven D'Aprano: On Wed, 27 Jan 2010 18:29:25 +0100, Alf P. Steinbach wrote: The main problem with the incompatibility is for porting code, not for writing code from scratch. Correct. It's a trivial problem, but still a problem. It's also a problem wrt. learning the l

Re: interaction of mode 'r+', file.write(), and file.tell(): a bug or undefined behavior?

2010-01-28 Thread Alf P. Steinbach
ation may fail with another implementation. What are you trying to accomplish? Overwrite the original file, or append to it? If you want to overwrite the file, it may be better to generate a new file, delete the old one, then rename the new one. If you want to append, then it would be be

Re: Need help with a program

2010-01-28 Thread Alf P. Steinbach
point it out. Thanks in advance! What do you expect as output, and what do you actually get as output? Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: is there any alternative to savefig?

2010-01-28 Thread Alf P. Steinbach
Thanks in advance, Robert Problem solved. That's nice, but would you mind telling the group the solution? Assuming that you haven't (I don't see all messages posted to the e-mail list, only what's propagated to Usenet or originating there). Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
ng inserted between values, default a space. end: string appended after the last value, default a newline. >>> _ Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
* Lie Ryan: On 01/28/10 20:12, Alf P. Steinbach wrote: >>> import builtins >>> >>> org_print = print >>> builtins.print = 666 >>> >>> print( "trallala" ) Traceback (most recent call last): File "", line

Re: mix statically typed with dynamically typed

2010-01-28 Thread Alf P. Steinbach
; invocations, say, then like def speed( dist: type( float ), time: type( float ) ) -> type( float ) Since there are umpteen projects to increase speed of Python this idea may already have been explored... Cheers & hth., - Alf (who has some other ideas) -- http://mail.python.org/mailman/listinfo/python-list

Re: mix statically typed with dynamically typed

2010-01-28 Thread Alf P. Steinbach
* Duncan Booth: "Alf P. Steinbach" wrote: I'm not sure I like your idea of introducing static typing to increase speed, but it could be done without introducing new syntax simply by defining a special meaning to such annotation expressions that are 'type' invocations,

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
key = locale.strxfrm ) >>> L ['å', 'æ', 'ø'] >>> locale.strcoll( "å", "æ" ) 1 >>> locale.strcoll( "æ", "ø" ) -1 >>> Note that strcoll correctly orders the strings as ["æ&qu

Re: python 3's adoption

2010-01-29 Thread Alf P. Steinbach
* Steven D'Aprano: On Fri, 29 Jan 2010 07:10:01 +0100, Alf P. Steinbach wrote: >>> L = ["æ", "ø", "å"] # This is in SORTED ORDER in Norwegian L [...] >>> L.sort( key = locale.strxfrm ) >>> L ['å', 'æ

Re: Microsoft Office Word and Python (Win XP)

2010-01-30 Thread Alf P. Steinbach
just post them. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: list.extend([]) Question

2010-01-30 Thread Alf P. Steinbach
None as its expression result, in the same way as e.g. the Python 3.x 'print' (another pure "doer" operation). >>> L = ['a'] >>> L ['a'] >>> L2 = L.extend( [] ) >>> L2 >>> L2 is None True >>> L ['a'] >>> _ Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Slow down while creating a big list and iterating over it

2010-01-30 Thread Alf P. Steinbach
any other language. Try to avoid repeating the same computations. Try to make the data fit the computational task. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3147 - new .pyc format

2010-01-30 Thread Alf P. Steinbach
for human readable file names :-( I agree. Human readable filenames would be much better. Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Still too slow

2010-01-30 Thread Alf P. Steinbach
routines above as methods. However in Python this may cause some overhead, so, perhaps first make it Work (and then make a Copy). :-) Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Still too slow

2010-01-30 Thread Alf P. Steinbach
* Alf P. Steinbach: * elsa: Thanks for the tips r.e random.ranint(). This improved matters somewhat, however my program is still too slow. If anyone has any further tips on how to speed it up, they would be much appreciated! So, I'm calling evolve(L,limit) from the interactive prompt.

Re: PEP 3147 - new .pyc format

2010-01-30 Thread Alf P. Steinbach
r question, but, just an idea: how about a human readable filename /with/ some bytecode version id (that added id could be the magic number)? I think that combo could serve both the human and machine needs, so to speak. :-) Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Alf P. Steinbach
sion still work in practice regardless of Python / Tkinter implementation? Cheers, - Alf (total newbie) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Alf P. Steinbach
* Rhodri James: On Tue, 20 Oct 2009 22:42:07 +0100, Alf P. Steinbach wrote: [snip] canvas.create_oval( bbox, fill = "PeachPuff" ) [snip] It worked nicely, and I thought this code was fairly perfect until I started studying the language reference. It seems that formally co

Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
-) Unfortunately Google docs doesn't display the nice table of contents in each document, but here's the public view of ch 1 (complete) and ch 2 (about one third completed, I've not yet settled on a title so it's just chapter "asd"): http://preview.tinyurl.com/p

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* Chris Rebert: On Tue, Oct 27, 2009 at 11:52 PM, Alf P. Steinbach wrote: [Cross-posted comp.programming and comp.lang.python] Hi. I may finally have found the perfect language for a practically oriented introductory book on programming, namely Python. C++ was way too complex for the novice

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* tm: On 28 Okt., 07:52, "Alf P. Steinbach" wrote: [Cross-posted comp.programming and comp.lang.python] Looking at your topic '(Python in Windows)', without taking a glimpse at your actual introduction, I have the following to say: I think it is not a good idea to teac

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* eb303: On Oct 28, 7:52 am, "Alf P. Steinbach" wrote: [snip] But since I don't know much Python -- I'm *learning* Python as I write -- I know that there's a significant chance of communicating misconceptions, non-idiomatic ways to do things, bad conventions, etc.,

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* eb303: On Oct 28, 10:48 am, "Alf P. Steinbach" wrote: * eb303: On Oct 28, 7:52 am, "Alf P. Steinbach" wrote: [snip] But since I don't know much Python -- I'm *learning* Python as I write -- I know that there's a significant chance of communicating misco

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* Jon Clements: On 28 Oct, 08:58, "Alf P. Steinbach" wrote: [snip] Without reference to an OS you can't address any of the issues that a beginner has to grapple with, including most importantly tool usage, without which it's not even possible to get started, but also, very

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
* Jon Clements: Inline reply: On 28 Oct, 11:49, "Alf P. Steinbach" wrote: * Jon Clements: On 28 Oct, 08:58, "Alf P. Steinbach" wrote: [snip] Without reference to an OS you can't address any of the issues that a beginner has to grapple with, including most import

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-28 Thread Alf P. Steinbach
"asd"): http://preview.tinyurl.com/progintro Cheers, Why is chapter 2 called "ASD"? The leftmost three keys on the middle row of the keyboard. :-) Cheers, - Alf "The Ramans do everything in threes" -- http://mail.python.org/mailman/listinfo/python-list

Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
taller ended prematurely. [...] Your system has not been modified". http://imgur.com/0kzMS.png OK, I'll try again /without/ asking it to compile. I'm just reporting this so that whoever needs to know knows (including maintainers and people wanting to install this). Cheers,

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Alf P. Steinbach: Hi. Or, to whomever this concerns... ;-) I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the "Advanced" option I told the installer to compil

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Alf P. Steinbach: * Alf P. Steinbach: Hi. Or, to whomever this concerns... ;-) I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the "Advanced" option I told the in

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 28 Oct 2009 19:30:13 -0300, Alf P. Steinbach escribió: Hm, the installer forgot to clean up, leaving lots of files, so contrary to the dialog's final message the system had been modified. If those files are third-party libraries, this confirms my previous

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 28 Oct 2009 19:18:48 -0300, Alf P. Steinbach escribió: I thought it would be prudent to install 3.1.1 for Windows from scratch, so I uninstalled everything (CPython, ActivePython), and then installed Python 3.1.1. In the "Advanced" option I told the

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* Mark Hammond: On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using MSI files has significant other advantages

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* David Robinow: On Wed, Oct 28, 2009 at 8:06 PM, Alf P. Steinbach wrote: PS: This was not unexpected. It was exactly why I earlier didn't even look at CPython (umpteen bad experiences with *nix ports) but used ActivePython. It's not a *nix port. It's multiplatform and it wor

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-28 Thread Alf P. Steinbach
* John Machin: On Oct 29, 11:06 am, "Alf P. Steinbach" wrote: (3) Tkinter not bundled, misleading & incomplete documentation. With the file associations in place (the installer managed to do that) running console programs works fine. However, running Tkinter based programs d

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 28 Oct 2009 21:06:03 -0300, Alf P. Steinbach escribió: The installer did manage to do the rest of that part correctly: file associations and PATHEXT variable. The Python installer from python.org does NOT add .py and .pyw to PATHEXT; the ActivePython one does

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Martin P. Hellwig: Alf P. Steinbach wrote: * tm: On 28 Okt., 07:52, "Alf P. Steinbach" wrote: [Cross-posted comp.programming and comp.lang.python] Looking at your topic '(Python in Windows)', without taking a glimpse at your actual introduction, I have the following t

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* James Harris: On 28 Oct, 08:58, "Alf P. Steinbach" wrote: * tm: On 28 Okt., 07:52, "Alf P. Steinbach" wrote: [Cross-posted comp.programming and comp.lang.python] Looking at your topic '(Python in Windows)', without taking a glimpse at your actual introdu

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Ethan Furman: Alf P. Steinbach wrote: * James Harris: You get way too deep into Python in places (for a beginner's course in programming). For example, "from now on I’ll always use from __future__ in any program that uses print." Sorry, but I think that hiding such con

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
. Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Benjamin Kaplan: On Thu, Oct 29, 2009 at 1:24 PM, Alf P. Steinbach wrote: ActiveState is simplest to install. However, given what I've now learned about the current situation wrt. versions of Python, where Python 3.x is effectively a new language, and where apparently ActiveState h

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* bartc: "Alf P. Steinbach" wrote in message news:hc8pn3$dd...@news.eternal-september.org... [Cross-posted comp.programming and comp.lang.python] I may finally have found the perfect language for a practically oriented introductory book on programming, namely Python. C++ w

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Rhodri James: On Thu, 29 Oct 2009 16:53:05 -, Alf P. Steinbach wrote: There's rather a lot to know about the environment that a program executes in if one is going to create robust, dependable, generally usable programs, not just toy examples. I'd say this was at best an

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Ethan Furman: Alf P. Steinbach wrote: * Ethan Furman: Alf P. Steinbach wrote: * James Harris: You get way too deep into Python in places (for a beginner's course in programming). For example, "from now on I’ll always use from __future__ in any program that uses print."

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* alex23: "Alf P. Steinbach" wrote: However, given what I've now learned about the current situation wrt. versions of Python, where Python 3.x is effectively a new language, and where apparently ActiveState has no installer for that, I'm rewriting to use the "officia

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
to as an IDE but is (1) also present in the ActiveState distribution and is (2) not really an IDE in any but perhaps a formal sense. It's just a primitive editor with a primitive debugger that, in Windows, has an annoying bug regarding highlighting of code. [snippety] Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* Alf P. Steinbach: * bartc: python.org seems to be the main site. Google "python download" and that is the first hit. Their windows download seems to be 13MB against the 32MB of activestate, and the IDE provided seems more advanced that the 'console window' you have i

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
rom the burden of choosing the most sensible way to execute the file (the user doesn't have to choose whether to use a console or GUI subsystem version of the interpreter, and the user doesn't even have to know that there is an interpreter involved). It's a common convention for

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* Mensanator: On Oct 30, 2:07 pm, "Alf P. Steinbach" wrote: * bartc: Python has a lot of baggage which is OK if that's what's going to be used, but otherwise is unnecessary confusion: where to put the program code (typed in live or in a file, or some combination); whet

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* alex23: "Alf P. Steinbach" wrote: And no, I didn't do any research on that. If it mattered more (e.g. appearing as statement in the text) I'd have done that. The nice thing about Usenet is that people rush in to correct things. ;-) http://xkcd.com/386/> Unfortunately

Feedback desired on reworked ch 1 progr. intro (now Python 3.x, Windows)

2009-10-31 Thread Alf P. Steinbach
1 is, well, better, addresses some of the concerns raised? http://preview.tinyurl.com/ProgrammingBookP3> Formats: PDF, text Now starting on ch 2, which with Python 3.x should become a lot cleaner... Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do you use python?

2009-10-31 Thread Alf P. Steinbach
tion here: http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.5> Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with read() write()

2009-10-31 Thread Alf P. Steinbach
ython 'open'): f = open("pw", "r+") f.write( "hello" ) f.seek( 0 ) # Go back to start of file f.read() f.close() Cheers & hth., - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with read() write()

2009-10-31 Thread Alf P. Steinbach
* Zeynel: On Oct 31, 9:23 am, "Alf P. Steinbach" wrote: * Zeynel: Hello, I've been studying the official tutorial, so far it's been fun, but today I ran into a problem with the write(). So, I open the file pw and write "hello" and read: f = open("pw&qu

<    1   2   3   4   5   6   7   >