Re: Plot problem.. ?? No sign at all

2010-07-06 Thread Alan G Isaac
On 7/6/2010 12:11 PM, Ritchy lelis wrote: My intention with de for loop was to iterate each point of the arrays Vi and Vref at the math calculations. The V0 it's the result of the math expressions between the Vi and Vref. I can't just create one V0 by a function set by parametters (i don't see ho

Re: Plot problem.. ?? No sign at all

2010-07-06 Thread Alan G Isaac
On 7/6/2010 8:05 AM, Ritchy lelis wrote: 1 - "import numpy as np import matplotlib.pyplot as plt" In what help's me making the call's of the libraries that way? http://bytebaker.com/2008/07/30/python-namespaces/ 2 - What's the instruction linspace means/does? >>> help(np.lins

Re: Plot problem.. ?? No sign at all

2010-07-05 Thread Alan G Isaac
On 7/5/2010 7:45 AM, Ritchy lelis wrote: from pylab import* Vref = arange(1, 20, 0.02) Vi = arange(1, 10,0.1) for i in Vref: for n in Vi: if n> i/4: V0 = 2*n-i elif (-i/4)<= n and n<= i/4: V0 = 2*n elif Vi< -i/4:

Re: improving IDLE

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! On Jun 25, 12:46 pm, Alan G Isaac wrote: Did you open an issue?http://bugs.python.org/ On 6/25/2010 4:26 PM, rantingrick wrote: If *I* open an issu

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 3:52 PM, Dave Angel wrote: I said "default", not "only" behavior. I suspect list provides an __iadd__ method to provide this ability. Integers do not, and therefore neither does the object the OP was asking about. I have no idea what "default behavior" is supposed to mean. Mut

value of: None is None is None

2010-06-25 Thread Alan G Isaac
Surprising for a moment, if you don't immediatelyrecognize it as a chained comparison. (Just sharing.) Alan Isaac None is None is None True (None is None) is None False None is (None is None) False -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue? http://bugs.python.org/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a good reason not to do it. So var+=increment can't be used because Python woul

best way to increment an IntVar?

2010-06-23 Thread Alan G Isaac
Of course one can do myintvar.set(myintvar.get()+1) but surely there is a better way? I'm surprsied that myintvar += 1 is not allowed. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

ttk Scale: missing attributes

2010-06-23 Thread Alan G Isaac
Tkinter's Scale widget had a `label` and a `resolution` attribute. These appear to be missing from the Ttk Scale widget. Is there a reason? These were important attributes. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANNC] pynguin-0.8 python turtle graphics application

2010-06-09 Thread Alan G Isaac
On 6/8/2010 6:59 PM, Lee Harr wrote: Pynguin is a python-based turtle graphics application. It combines an editor, interactive interpreter, and graphics display area. Do you start from scratch or make use of the very useful new (2.6) turtle module? I hope the latter, and that you ar

modify XMP data (Python/Windows)

2010-06-05 Thread Alan G Isaac
I want to modify XMP data for a bunch of JPEG files, using Python if possible, on Windows. I expected PIL would support this. But no? I found the Python XMP Toolkit http://www.spacetelescope.org/static/projects/python-xmp-toolkit/docs/installation.html#requirements but no reports of successful

Re: documentation bug? (format spec mini language)

2010-05-12 Thread Alan G Isaac
On 5/11/2010 5:05 PM, Terry Reedy wrote: http://bugs.python.org/issue8691 Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
On 5/11/2010 3:19 PM, MRAB wrote: You usually want numbers to be right-aligned so that the decimal points line up when writing a columns of them. Yes. I'm not questioning the wisdom of the implementation, just the documentation of it. Thanks, Alan -- http://mail.python.org/mailman/listinfo/

documentation bug? (format spec mini language)

2010-05-11 Thread Alan G Isaac
The documentation at http://docs.python.org/py3k/library/string.html#format-specification-mini-language '<' Forces the field to be left-aligned within the available space (This is the default.) The conflicting example:: >>> format(3.2,'10.5f') ' 3.2' >>>

Re: change an exception's message and re-raise it

2009-12-31 Thread Alan G Isaac
On 12/31/2009 7:30 PM, Steven D'Aprano wrote: The message attribute is deprecated from Python 2.6 and will print a warning if you try to use it. http://bugs.python.org/issue6844 fwiw, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string substitution problem

2009-12-18 Thread Alan G Isaac
On 12/18/2009 12:17 PM, MRAB wrote: In simple cases you might be replacing with the same string every time, but other cases you might want the replacement to contain substrings captured by the regex. Of course that "conversion" is needed in the replacement. But e.g. Vim substitutions handle th

Re: Raw string substitution problem

2009-12-18 Thread Alan G Isaac
On 12/17/2009 7:59 PM, Rhodri James wrote: "re.compile('a\\nc')" passes a sequence of four characters to re.compile: 'a', '\', 'n' and 'c'. re.compile() then does it's own interpretation: 'a' passes through as is, '\' flags an escape which combined with 'n' produces the newline character (0x0a),

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
On 12/17/2009 2:45 PM, MRAB wrote: re.compile('a\\nc') _does_ compile to the same as regex as re.compile('a\nc'). However, regex objects never compare equal to each other, so, strictly speaking, re.compile('a\nc') != re.compile('a\nc'). However, having said that, the re module contains a cache

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
Alan G Isaac wrote: >>> re.sub('abc', r'a\nb\n.c\a','123abcdefg') == re.sub('abc', 'a\\nb\\n.c\\a','123abcdefg') == re.sub('abc', 'a\nb\n.c\a','123abcdefg') True Why are the

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
On 12/17/2009 11:24 AM, Richard Brodie wrote: A raw string is not a distinct type from an ordinary string in the same way byte strings and Unicode strings are. It is a merely a notation for constants, like writing integers in hexadecimal. (r'\n', u'a', 0x16) ('\\n', u'a', 22) Yes, that was

Re: Raw string substitution problem

2009-12-17 Thread Alan G Isaac
En Wed, 16 Dec 2009 11:09:32 -0300, Ed Keith escribió: I am having a problem when substituting a raw string. When I do the following: re.sub('abc', r'a\nb\nc', '123abcdefg') I get """ 123a b cdefg """ what I want is r'123a\nb\ncdefg' On 12/16/2009 9:35 AM, Gabriel Genellina wrote: Fr

Re: restriction on sum: intentional bug?

2009-10-17 Thread Alan G Isaac
On 10/16/2009 8:16 PM, Terry Reedy wrote: The fact that two or three people who agree on something agree on the thing that they agree on confirms nothing. On 10/17/2009 7:03 PM, Terry Reedy wrote: If you disagree with this, I think *you* are being silly. Well, ... Alan G Isaac wrote: Of

Re: restriction on sum: intentional bug?

2009-10-17 Thread Alan G Isaac
On 10/17/2009 7:06 AM, Carl Banks wrote: I'm basically saying here is, by shutting out strings from sum, you don't really lose much in terms of duck typing, because duck typing wouldn't have been that helpful anyway. That boils down to an argument for type checking whenever you cannot imagine m

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
Alan G Isaac gmail.com> writes: So of course join is better, as originally noted, but that does not constitute a reason to intentionally violate duck typing. On 10/16/2009 1:03 PM, Benjamin Peterson wrote: As Stephen pointed out, duck typing is not an absolute. I do not recall any

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
On 10/16/2009 8:16 PM, Terry Reedy wrote: The fact that two or three people who agree on something agree on the thing that they agree on confirms nothing. One could just as well argue that summing anything but numbers is semantically incoherent, not correct. Certainly, my dictionary points in tha

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
On 10/16/2009 5:03 PM, Christian Heimes wrote: It's not going to happen. That's a prediction, not a justification. As Tim explained in detail, and as Peter explained with brevity, whether it will happen or not, it should happen. This conversation has confirmed that current behavior is a wart:

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
On 10/16/2009 3:40 PM, Tim Chase wrote: What's always wrong is giving me an *error* when the semantics are perfectly valid. Exactly. Which is why I expected this to be fixed in Python 3. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
Alan G Isaac schrieb: I expected this to be fixed in Python 3: sum(['ab','cd'],'') Traceback (most recent call last): File "", line 1, in TypeError: sum() can't sum strings [use ''.join(seq) instead] Of course it is not a good

restriction on sum: intentional bug?

2009-10-16 Thread Alan G Isaac
I expected this to be fixed in Python 3: sum(['ab','cd'],'') Traceback (most recent call last): File "", line 1, in TypeError: sum() can't sum strings [use ''.join(seq) instead] Of course it is not a good way to join strings, but it should work, should it not? Naturally, '' + 'ab' + 'cd'

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Alan G Isaac
Dr. Phillip M. Feldman writes: I currently have a function that uses a list internally but then returns the list items as separate return values as follows: if len(result)==1: return result[0] if len(result)==2: return result[0], result[1] (and so on). Is there a cleaner way to accomplish the

Re: Programming ideas?

2009-09-20 Thread Alan G Isaac
You could learn a lot of Python contributing to docutils or bibstuff, and if you write papers or presentations, it may pay off directly. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a pure Python chart drawing module

2009-09-16 Thread Alan G Isaac
Alan G Isaac wrote: There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. On 9/16/2009 12:33 AM, John Nagle wrote: "The package is a wrapper around Tkinter". It runs Tkinter in a separate thread and sends commands to it.

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Alan G Isaac
There's John Zelle's graphics.py: http://mcsp.wartburg.edu/zelle/python/ provides basic functionality. Pmw.Blt http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/reference.html pygooglechart You suggested this needs a browser, but not so, you can download the PNGs and use the default viewer to display them

Re: string interpolation mystery in Python 2.6

2009-09-12 Thread Alan G Isaac
On 9/11/2009 9:42 PM, Steven D'Aprano wrote: However, I must admit I'm perplexed why the original example is calling __unicode__() in the first place! Given the line: raise self.severe('Problems with "%s" directive path:\n%s: %s.' % (self.name, error.__class__.__name__, error)) it looks to

Re: string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
Michael Foord came up with a much simpler illustration. With Python 2.6:: >>> try: ... open('flooble') ... except Exception as e: ... pass ... >>> e IOError(2, 'No such file or directory') >>> unicode(e) u"(2, 'No such fil

Re: Use python to execute a windows program

2009-09-11 Thread Alan G Isaac
Does the Windows application offer a COM interface? http://oreilly.com/catalog/pythonwin32/chapter/ch12.html http://sourceforge.net/projects/pywin32/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

string interpolation mystery in Python 2.6

2009-09-11 Thread Alan G Isaac
MYSTERY: how can "%s"%error be different from "%s"%str(error) in Python 2.6? APOLOGY: I tried to strip this down, but could not find a simple way to reproduce the problem. This way works, however. (There is a discussion on the docutils-develop list.) Although there are several steps, we are ta

Re: incorrect DeprecationWarning (patch needed)

2009-09-08 Thread Alan G Isaac
On 9/5/2009 5:50 PM, Alan G Isaac wrote: I've filed a bug report: http://bugs.python.org/issue6844 This is now an accepted bug with a patch request. Can someone on this list please assist with a patch? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
I've filed a bug report: http://bugs.python.org/issue6844 Sadly the Twisted developers apparently did not file a bug report when they were bitten by this ... Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
On 9/5/2009 9:07 AM, exar...@twistedmatrix.com wrote: You are using the deprecated practice. Clearly not, or it would fail in Python 3, which it does not. Attributes are not scoped to a particular class. There is only one "message" attribute on your "MyError" instance. It does not belong just

Re: incorrect DeprecationWarning?

2009-09-05 Thread Alan G Isaac
Alan G Isaac wrote: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. class MyError(Exception): ... def __init__(self, message): ... Exception._

incorrect DeprecationWarning?

2009-09-04 Thread Alan G Isaac
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. class MyError(Exception): ... def __init__(self, message): ... Exception.__init__(self) ... self.message = message ...

Re: Select column from a list

2009-08-28 Thread Alan G Isaac
On 8/28/2009 3:45 AM hoffik wrote: > I'm quite new in Python and I have one question. I have a 2D matrix of > values stored in list (3 columns, many rows). I wonder if I can select one > column without having to go through the list with 'for' command. Not quite what you asked but ... >>> rows = [

Re: flatten a list of list

2009-08-16 Thread Alan G Isaac
On 8/16/2009 5:47 AM Terry apparently wrote: > Is there a simple way (the pythonic way) to flatten a list of list? > rather than my current solution: > new_list=[] > for l in list_of_list: > new_list.extend(l) new_list = list(xi for lst in list_of_list for xi in lst) hth, Alan Isaac -- h

Re: random.gauss vs. random.normalvariate

2009-08-15 Thread Alan G Isaac
> On Aug 15, 12:49 pm, Alan G Isaac wrote: >> Quotinghttp://docs.python.org/3.1/library/random.html#random.gauss: >> Gaussian distribution. mu is the mean, and sigma is the >> standard deviation. This is slightly faster than the >> normalvariate() funct

random.gauss vs. random.normalvariate

2009-08-15 Thread Alan G Isaac
Quoting http://docs.python.org/3.1/library/random.html#random.gauss: Gaussian distribution. mu is the mean, and sigma is the standard deviation. This is slightly faster than the normalvariate() function defined below. So since both are offered and gauss is faster, I assume it must have

Re: retrieve item from nested list given index tuple

2009-08-14 Thread Alan G Isaac
On 8/14/2009 1:09 PM Steven D'Aprano apparently wrote: > Try this instead: > from operator import getitem reduce(getitem, (2, 1, 0), lst) > 'aaa' reduce(getitem, (2, 1, 0, 0), lst) > 'a' > > operator.getitem is less ugly too. Yes, that's better. Thanks, Alan -- http://mail.pytho

retrieve item from nested list given index tuple

2009-08-14 Thread Alan G Isaac
`lst` is a nested list `tpl` is the indexes for an item in the list What is the nice way to retrieve the item? (Speedy access is nice.) I don't want to use NumPy, but I'd like somehow to avoid an explicit loop. I did consider using eval. E.g., eval('lst' + '[%d]'*len(tpl)%tpl). It works but se

Re: csv.DictWriter.write_header()

2009-08-14 Thread Alan G Isaac
> On Aug 13, 1:15 pm, Alan G Isaac wrote: >> I do not understand the reason for your silly, sarcastic response. On 8/13/2009 7:58 AM John Machin apparently wrote: > Duck typing: ask a silly question, get a silly answer. Maybe if you learned to be a more generous reader, fewer que

Re: csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
> On Aug 13, 6:45 am, Alan G Isaac wrote: >> Given a csv.DictWriter instance `dw` >> I think it would be nice to be able to >> say dw.write_header() >> instead of >> dw.writer.writerow(dw.fieldnames) >> >> Good idea? On 8/12/2009 10:24 PM John Mac

csv.DictWriter.write_header()

2009-08-12 Thread Alan G Isaac
Given a csv.DictWriter instance `dw` I think it would be nice to be able to say dw.write_header() instead of dw.writer.writerow(dw.fieldnames) Good idea? Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: invoke method on many instances

2009-07-22 Thread Alan G Isaac
>>> On Fri, 17 Jul 2009 05:19:50 +0000, Alan G Isaac wrote: >>>> def apply2(itr, methodname, *args, **kwargs): >>>> f = operator.methodcaller(methodname, *args, **kwargs) >>>> for item in itr: >>>> f(item) >> On 7/1

Re: are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
> * Alan G Isaac [2009-07-19 13:48:16 +]: >> Are user defined classes hashable? >> (The classes; *not* the instances!) >> I'm inclined to guess it will be hashed by id and this is >> OK. On 7/19/2009 10:07 AM Nicolas Dandrimont apparently wrote: > Y

are user defined classes hashable?

2009-07-19 Thread Alan G Isaac
Are user defined classes hashable? (The classes; *not* the instances!) I want to use some classes as dictionary keys. Python is not objecting, but I'm not sure how to think about whether this could be dangerous. I'm inclined to guess it will be hashed by id and this is OK. Thanks for any insights

Re: invoke method on many instances

2009-07-18 Thread Alan G Isaac
> On Fri, 17 Jul 2009 05:19:50 +0000, Alan G Isaac wrote: >> def apply2(itr, methodname, *args, **kwargs): >> f = operator.methodcaller(methodname, *args, **kwargs) >> for item in itr: >> f(item) On 7/17/2009 3:45 AM Steven D'Aprano appare

invoke method on many instances

2009-07-16 Thread Alan G Isaac
As a recurrent situation, I need to invoke the same method on many instances. Speed matters, but the solution should be pure Python. Is the following convenience function a reasonable approach? def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwarg

Re: Clarity vs. code reuse/generality

2009-07-04 Thread Alan G Isaac
On 7/4/2009 12:30 PM kj apparently wrote: > I'm beginning to think that the original "precept" was simply "cargo > cult," i.e. one of those rules that are parroted without being > fully understood. Adopting such a view is of course an alternative to attempting to understand, but perhaps less usef

3.1 Windows Installer trashes extension registrations

2009-07-03 Thread Alan G Isaac
> Alan G Isaac wrote: >> Using the 3.1 Windows installer, I chose that I did not >> want the extensions registered, and the installer >> unregistered the .py and .pyw extensions (which I had >> wanted to keep associated with Python 2.6). >> Is this intentional?

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Alan G Isaac
> In Alan G Isaac > writes: >> 1. Don't use assertions to test argument values! On 7/3/2009 12:19 PM kj apparently wrote: > Out of curiosity, where does this come from? http://docs.python.org/reference/simple_stmts.html#grammar-token-assert_stmt "The current cod

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Alan G Isaac
On 7/3/2009 10:05 AM kj apparently wrote: > The context is the concept of a binary search. In one of their > homeworks, my students will have two occasions to use a binary > search. This seemed like a perfect opportunity to illustrate the > idea of abstracting commonalities of code into a re-usab

Re: Python 3.0 (pinin' for the fjords)

2009-07-02 Thread Alan G Isaac
Using the 3.1 Windows installer, I chose that I did not want the extensions registered, and the installer unregistered the .py and .pyw extensions (which I had wanted to keep associated with Python 2.6). Is this intentional? Alan Isaac PS I already fixed the problem. My question is about intent

Re: Open source python projects

2009-06-22 Thread Alan G Isaac
On 6/22/2009 3:40 PM saurabh apparently wrote: > I am an experienced C programmer and recently dived into python, > I have developed an instant love for it. > I have been doing some routine scripting for day to day admin tasks,also > have done some Tkinter and socket programming using python. > >

Re: Regarding Python is scripting language or not

2009-06-19 Thread Alan G Isaac
On 6/17/2009 8:38 AM Jean-Michel Pichavant apparently wrote: > I'm pretty sure you'll be able to find OOP scripting > language. http://www.amazon.com/Scripting-Objects-Comparative-Presentation-Object-Oriented/dp/047039725X/ref=sr_1_1?ie=UTF8&s=books&qid=1245276357&sr=1-1> fwiw, Alan Isaac -- h

Re: please help...writing set to a file

2009-06-18 Thread Alan G Isaac
On 6/18/2009 5:24 AM yadin apparently wrote: > I got this python program that returns me a set like this.. > Set ([‘A\n’, B\n’, ‘C\n’, ‘D\n’, ‘E\n’, ‘F\n’, ‘G\n’ ]) > And a list pp = [‘100\n’ ‘200\n’ ‘300\n’ ‘400\n’] > I was reading this from a file…. > How can I transform this to something that lo

Re: Perl's @foo[3,7,1,-1] ?

2009-06-17 Thread Alan G Isaac
On 6/17/2009 4:03 PM J. Cliff Dyer apparently wrote: > example code > should always include relevant imports. Agreed. It was a cut and paste failure. Apologies. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl's @foo[3,7,1,-1] ?

2009-06-16 Thread Alan G Isaac
On 6/13/2009 2:11 PM kj apparently wrote: > Switching from Perl here, and having a hard time letting go... > > Suppose I have an "array" foo, and that I'm interested in the 4th, 8th, > second, and last element in that array. In Perl I could write: > > my @wanted = @foo[3, 7, 1, -1]; >>> a = n

Re: trying to understand dictionaries

2009-06-12 Thread Alan G Isaac
On 6/12/2009 7:51 AM khem...@gmail.com apparently wrote: > d = {'fname': [], 'ename': []} > name1 = 'ricky' > name2 = 'martin' > d['fname'].append(name1) > d['ename'].append(name2) > > name1 = 'britney' > name2 = 'spears' > d['fname'].append(name1) > d['ename'].append(name2) > > > This gives me:

Re: matplotlib installation

2009-06-12 Thread Alan G Isaac
On 6/12/2009 5:55 AM Virgil Stokes apparently wrote: > Any suggestions on installing matplotlib for Python 2.6.2 on a Windows > Vista platform? Maintainers for some packages have run into a wall compiling for 2.6. Matplotlib is one of these: http://www.nabble.com/binary-installers-for-python2.6

Re: define "generator" (glossary bug?)

2009-05-22 Thread Alan G Isaac
On 5/22/2009 1:44 PM s...@pobox.com apparently wrote: Note that the glossary page is on the wiki. Feel free to make corrections. Well, ok, I've done so: http://wiki.python.org/moin/PythonGlossary But I'm just a user. Someone should check it. Thanks, Alan Isaac -- http://mail.python.org/mai

Re: define "generator" (glossary bug?)

2009-05-22 Thread Alan G Isaac
On Fri, 22 May 2009 16:38:40 GMT, Alan G Isaac wrote: I believe the glossary http://wiki.python.org/moin/PythonGlossary is missing the definition for 'generator' and has used instead the definition for 'generator function', which term is missing from the glossary.

define "generator" (glossary bug?)

2009-05-22 Thread Alan G Isaac
I believe the glossary http://wiki.python.org/moin/PythonGlossary is missing the definition for 'generator' and has used instead the definition for 'generator function', which term is missing from the glossary. Standard usage as I understand it is found here: http://docs.python.org/3.0/reference/

Re: reseting an iterator

2009-05-20 Thread Alan G Isaac
Jan wrote: Wouldn't it be easy for Python to implement generating functions so that the iterators they return are equipped with a __reset__() method? Use ``send``: http://docs.python.org/whatsnew/2.5.html#pep-342-new-generator-features Remember, there may be no underlying sequence object for a

Re: LaTeXing python programs

2009-05-20 Thread Alan G Isaac
On Wednesday 20 May 2009 18:43:21 Edward Grefenstette wrote: is there a LaTeX package out there that works well for presenting python code? José Matos wrote: Use the listings package. It has a python as one of defined languages and has lots of other options. http://www.ctan.org/tex-archive/

Re: 2d barcode library?

2009-05-20 Thread Alan G Isaac
Christian Heimes wrote: https://cybernetics.hudora.biz/projects/wiki/huBarcode Cool. I have to mention a pure PostScript writer as well: http://www.terryburton.co.uk/barcodewriter/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: rectangles, or cavases, or ... ? under Tkinter

2009-04-20 Thread Alan G Isaac
On Apr 20, 5:29 pm, Alan G Isaac wrote: I need to display many (e.e., 2000) small squares whose colors are udpated each time a computation is complete. One approach is to put rectangles on a single canvas. Another approach is to put many canvases in a single frame. Another approach is to

Re: rectangles, or cavases, or ... ?

2009-04-20 Thread Alan G Isaac
On 4/20/2009 7:43 PM John McMonagle apparently wrote: Approach 1: put many rectangles on a single canvas This is the most flexible approach. It allows you to take advantage of Tkinter canvas tag bindings to interact with individual or groups of canvas items. It also allows you to use some pre

Re: rectangles, or cavases, or ... ?

2009-04-20 Thread Alan G Isaac
On 4/20/2009 5:59 PM Scott David Daniels apparently wrote: You should have said, but I'll guess you are using Tkinter. Yes, I should have, sorry. You are right, I'm using Tkinter. I'd put the rectangles on a canvas, myself. That's my current choice, but I'm not seeing into what the trade-

rectangles, or cavases, or ... ?

2009-04-20 Thread Alan G Isaac
I need to display many (e.e., 2000) small squares whose colors are udpated each time a computation is complete. One approach is to put rectangles on a single canvas. Another approach is to put many canvases in a single frame. Another approach is to create an image each iteration, which is placed

Re: color propagation in tkinter

2009-04-20 Thread Alan G Isaac
On Apr 20, 12:35 pm, Alan G Isaac wrote: If I want to propagate changes to a font, I can just use a named font. What if I want to propagate color changes? (E.g., a change in background color for a number of widgets.) On 4/20/2009 1:59 PM Mike Driscoll apparently wrote: One way would be to

color propagation in tkinter

2009-04-20 Thread Alan G Isaac
I'm a tkinter novice. If I want to propagate changes to a font, I can just use a named font. What if I want to propagate color changes? (E.g., a change in background color for a number of widgets.) Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python after a few years of Ruby

2009-04-14 Thread Alan G Isaac
On 4/14/2009 3:01 AM blahemailb...@gmail.com apparently wrote: 1) Rake - is there an equivalent of Rake? I've seen a bit about SCons, and it looks really nice, but it seems geared towards being a Make replacement for C/C++ rather than something that's used to work with Python itself. Is there any

Re: DVCSs wreck tkFileDialog

2009-04-14 Thread Alan G Isaac
More info: http://sourceforge.net/mailarchive/forum.php?thread_name=A46CBF978138744AAC019E6FF055EAB70F30AE%40apatlelsmail08.elsys.gtri.org&forum_name=tortoisehg-develop> Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: possible pairings in a set

2009-04-13 Thread Alan G Isaac
I cannot access this thread right now so my answer my be rednundant, but anyway: http://docs.python.org/library/itertools.html#itertools.combinations >>> from itertools import combinations >>> print(list(combinations(range(4),2))) [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)] hth,

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
On Apr 13, 11:26 am, Alan G Isaac wrote: Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or

tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter as tk >>> root=tk.Tk() >>> im

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Alan G Isaac
On 3/30/2009 3:37 AM Eric Brunel apparently wrote: The string representation of Tkinter objects seems to be a design principle in this module: it'll always evaluate to the representation this object has at tcl level. Since a XxxVar is represented by an actual variable at tcl level, its string rep

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Alan G Isaac
On 3/30/2009 3:37 AM Eric Brunel apparently wrote: The object traditionally called root is in fact an instance of the tcl interpreter that will get the commands generated by the Tkinter module. Due to tk architecture, creating this interpreter will also create a window, which is inteneded to be y

Re: email from windows

2009-03-29 Thread Alan G Isaac
2009/3/29 prakash jp : In windows environment, how to send email from one gmail address to another gmail (or another mail) addrress On 3/29/2009 10:20 PM Chris Rebert apparently wrote: Use the `smtplib` and `email` standard libraries (which, as a bonus, are cross-platform): http://docs.python

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
On Mon, 30 Mar 2009 00:13:46 +0100, Alan G Isaac wrote: Since you did not address my question about the nuance of "magic", I'm inclined to treat you as a "no" vote. On 3/29/2009 7:19 PM Rhodri James apparently wrote: And you'd be wrong. So seriously, you&#

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
On 3/29/2009 6:49 PM Scott David Daniels apparently wrote: Right. Tkinter could have been built to make a root at the first instantiation of a StringVar or IntVar, but it wasn't. Answering your why is a bit like answering the "Why did Picasso choose primarily blue in his Blue Period, rather

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
On 3/29/2009 6:50 PM Rhodri James apparently wrote: In this case, your choice of wording (the nearest thing we have in print to "tone of voice") did not inspire me to go digging around in source that you have just as easy access to, in order to answer questions that I'm not particularly intereste

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
On 3/29/2009 2:46 PM Scott David Daniels apparently wrote: You ask, "What exactly is the role of ...", rather than saying something like, "I don't understand the role of ...", and continue to ask why the code is not architected the way you first expected it to be architected, calling those thi

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
Alan asked: - Why does a Variable need a master? - If s is a StringVar instance, why is str(s) its name rather than its value? On 3/29/2009 2:46 PM Scott David Daniels apparently wrote: The answer to that, grasshopper, lies in the answer to the question, "What are StringVars designed to do?

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
On 3/29/2009 7:29 AM Francesco Bochicchio apparently wrote: 1. Tkinter is only a thin wrapper over Tk, a GUI library initially developed for Tcl language, so many of the answer to the design choices you question (e.g. what is the master) cannot between answered within the python documentation b

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Alan G Isaac
On 3/29/2009 3:43 AM Scott David Daniels apparently wrote: OK, that was plain rude. a couple of questions is not six questions. A reply telling you how to get to some of what you are looking for is assistance. If you want exact answers to an array of questions, pay someone to fetch you the answ

Re: tkinter questions: behavior of StringVar, etc

2009-03-28 Thread Alan G Isaac
On Mar 28, 2:15 pm, Alan G Isaac wrote: I'm a complete newbie to GUI. I have a couple questions about tkinter. 1. Where is the list of changes in Python 3's tkinter? 2. What exactly is the role of the root object, traditionally created as ``root=tk.Tk()``? What is

tkinter questions: behavior of StringVar, etc

2009-03-28 Thread Alan G Isaac
I'm a complete newbie to GUI. I have a couple questions about tkinter. 1. Where is the list of changes in Python 3's tkinter? 2. What exactly is the role of the root object, traditionally created as ``root=tk.Tk()``? What is an example where one should create this before creating a F

Re: What's the difference between generating a value and returning a value?

2009-03-23 Thread Alan G Isaac
On 3/23/2009 6:12 PM grocery_stocker apparently wrote: http://openbookproject.net/thinkCSpy/ch05.xhtml#index15 "The built-in functions we have used, such as abs, pow, and max, have produced results. Calling each of these functions generates a value, which we usually assign to a variable or use

  1   2   >