Re: Messing with the GC

2013-01-20 Thread Terry Reedy
can be deleted, when it should not be) can lead to segfaults. So I would report PySide code leading to segfaults to the PySide people. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Help splitting CVS data

2013-01-20 Thread Terry Reedy
On 1/20/2013 5:04 PM, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files ... I'm stuck, comments and solutions greatly appreciated. Why are you not using the cvs module

Re: Windows subprocess.call problem

2013-01-21 Thread Terry Reedy
s parameters in one invocation of notepad? Assuming Notepad is written reasonably, that'll give it all to you in one window, instead of opening many separate ones. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: pycache directories

2013-01-21 Thread Terry Reedy
with every run. So that option is meant for running off a read-only medium. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving the full command line

2013-01-22 Thread Terry Reedy
served, in a sense, like similar identifiers in programs, and '__main__.py' should not be used for a file meant to executed directly. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Understanding while...else...

2013-01-22 Thread Terry Reedy
while condition is that the iterable has another item to process. So the else clause executes if and when that condition is false, when iter(iterable) is exhausted. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding while...else...

2013-01-22 Thread Terry Reedy
On 1/22/2013 3:09 PM, Ethan Furman wrote: On 01/22/2013 09:44 AM, Terry Reedy wrote: Several people have trouble understanding Python's while-else and for-else constructs. It is actually quite simple if one starts with if-else, which few have any trouble with. Start with, for example if

Re: Understanding while...else...

2013-01-23 Thread Terry Reedy
g the compiled code ? I'm quite not sure about that... The dis output was an optional appendix for anyone who doubted the correctly of my claimed python-level equivalence ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding while...else...

2013-01-23 Thread Terry Reedy
On 1/22/2013 7:39 PM, Oscar Benjamin wrote: On 22 January 2013 23:41, Terry Reedy wrote: On 1/22/2013 3:09 PM, Ethan Furman wrote: On 01/22/2013 09:44 AM, Terry Reedy wrote: [SNIP] The else clause is executed if and when the condition is false. Now use a real Python while statement to do

Re: Arent these snippets equivalent?

2013-01-23 Thread Terry Reedy
of the items of a collection from the processing of the same items. The two processes are often quite independent, and separating them clearly allows us to mix and match. For instance, when summing numbers, the internal details of producing the numbers does not matter. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Galry, a high-performance interactive visualization package in Python

2013-01-29 Thread Terry Reedy
ke your python code also support 3.x. Use the future imports for print and unicode. Others have written more guidelines. "Numpy, either PyQt4 or PySide, PyOpenGL, matplotlib" These all support 3.2,3.3 (PyOpenGl says 'experimental'). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy array operation

2013-01-29 Thread Terry Reedy
first slice would have to be list(reversed(a)) to get the same result. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: how to use subprocess to execute an exe with args and an output

2013-01-30 Thread Terry Reedy
uot;: x = subprocess.Popen([r"C:\Program Files (x86)\GPSBabel\gpsbabel.exe", "-i", "gdb", "-f", r"C:\Temp\GDBdata\testgps28.gdb", "-o", "gpx", r"C:\Temp\gpx\test28output.gpx"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) and it is apparently best to not use shell=True unless actually needed for shell processing, which I do not think is the case here. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: (any)dbm module lacks a context manager

2013-01-31 Thread Terry Reedy
AttributeError: '_dbm.dbm' object has no attribute '__exit__' I'm guessing it's an easy fix? (or even already fixed) Go to our public tracker, enter 'dbm context manager' in the top search box, (change Status to 'don't care' in case there

Re: Help the visibility of Python in computational science

2013-01-31 Thread Terry Reedy
to the article: http://www.scholarpedia.org/article/Brian_simulator 'Brian' is obviously a play on 'brain', with two letters transposed. But comparison of the logo on the page above with the image on https://en.wikipedia.org/wiki/Life_of_brian shows another source

Re: Using an object inside a class

2012-01-23 Thread Terry Reedy
led. So purely from what you have presented above, it would seem that 'foo' is defined between the call to __init__ and a later call to method1. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: String interning in Python 3 - missing or moved?

2012-01-23 Thread Terry Reedy
shes for strings either are or in 3.3 will always be cached. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining version of OpenSSL linked against python?

2012-01-25 Thread Terry Reedy
Can anyone offer any suggestions as to what is going wrong with the above code or offer an alternative way of determining the OpenSSl version using python-2.6? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: Python regular expression syntax is not intuitive.

2012-01-25 Thread Terry Reedy
open source programs, including several Python versions. https://en.wikipedia.org/wiki/Pcre has some info on this. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: to express unicode string

2012-01-28 Thread Terry Reedy
t, in less than a year. We went through the hassle of changing the string type from bytes to unicode *because* having unicode as merely an add-on type was not working very well. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: object aware of others

2012-01-28 Thread Terry Reedy
ake self out of that list. Sets are much better for removal. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread Terry Reedy
Yes. Yes. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE not setting current directory in its path

2012-01-30 Thread Terry Reedy
r paths...] instead of showing [' ', other paths..]. This issue is under consideration at http://bugs.python.org/issue13506 I will be looking at the patch soon. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-01-30 Thread Terry Reedy
debug failures. Is there some way to globally tell python, "Never import a .pyc unless the corresponding .py file exits"? Upgrade to 3.2. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE not setting current directory in its path

2012-01-30 Thread Terry Reedy
On 1/30/2012 3:15 PM, Terry Reedy wrote: This issue is under consideration at http://bugs.python.org/issue13506 It should be fixed before the next Python releases. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE not setting current directory in its path

2012-01-31 Thread Terry Reedy
On 1/31/2012 11:27 AM, gujax wrote: Thanks Terry, I see that the issue has been closed by you. However, I do not know how to run the patch on my Windows. Do I reinstall IDLE? Please suggest. I am using Python2.7 Choices: 1. Wait for the next 2.7 release, which should be within a month. Easiest

Re: Disable use of pyc file with no matching py file

2012-01-31 Thread Terry Reedy
On 1/31/2012 3:20 PM, John Roth wrote: On Jan 30, 3:43 pm, Terry Reedy wrote: On 1/30/2012 4:30 PM, Roy Smith wrote: Every so often (typically when refactoring), I'll remove a .py file and forget to remove the corresponding .pyc file. If I then import the module, python finds the orp

Re: Disable use of pyc file with no matching py file

2012-01-31 Thread Terry Reedy
But I am sure that 95% of readers here will be using 3.x withing 10 years. The only question for them is "When?". This not-well-known new feature is one straw that some will put on the 'sooner' side of the balance. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: except clause syntax question

2012-01-31 Thread Terry Reedy
objects to be interpolated. That was on # Python once treated tuples as different from lists in ways that is not true now. (Read the 1.5 docs if really interested.) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: configobj

2012-01-31 Thread Terry Reedy
with ConfigObj. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I verify if the content of a variable is a list or a string?

2012-01-31 Thread Terry Reedy
tance(object,class) but I don't know which class should I use for. For 3.x, 'list' or 'str' (where 'str' means unicode). For 2.x, I believe 'basestring' includes unicode strings as well as byte strings. >>> isinstance([], list) True

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Terry Reedy
so they no longer say that they have not converted for lack of demand ;-) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Terry Reedy
imperfect. I acknowledged that the transition will take years. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Terry Reedy
On 2/1/2012 8:11 AM, John Roth wrote: One other point: I'm unclear if a compiled module in the source directory would be named spam.pyc or spam.cpython-32.pyc. I'd think the latter to allow two versions of a compiled-only distribution. By test, it has to be spam.pyc, as before. --

Re: Buffering in Wing and IDLE 3

2012-02-01 Thread Terry Reedy
y be available through ActiveState's distribution." -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-02-02 Thread Terry Reedy
On 2/2/2012 1:42 AM, Devin Jeanpierre wrote: On Wed, Feb 1, 2012 at 2:53 PM, Terry Reedy wrote: And it bothers me that you imput such ignorance to me. You made what I think was a bad analogy and I made a better one of the same type, though still imperfect. I acknowledged that the transition

Re: copy on write

2012-02-02 Thread Terry Reedy
PEP, if there is one, or the dicussion ( probably on pydev list). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python embeded in c++ application. Can't load python module if application is placed in folder with unicode chars.

2012-02-02 Thread Terry Reedy
.x, but even then, a mismatch between encodings is a problem. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple constructor __init__

2012-02-02 Thread Terry Reedy
=default):... -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-05 Thread Terry Reedy
built with VS2010. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: difference between random module in python 2.6 and 3.2?

2012-02-05 Thread Terry Reedy
t a power of two. Now, multiple selections are made from a range up to the next power of two and a selection is kept only when it falls within the range 0 <= x < n. The functions and methods affected are randrange(), randint(), choice(), shuffle() and sample(). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: difference between random module in python 2.6 and 3.2?

2012-02-05 Thread Terry Reedy
On 2/6/2012 12:56 AM, Steven D'Aprano wrote: On Mon, 06 Feb 2012 00:07:04 -0500, Terry Reedy wrote: On 2/5/2012 11:01 PM, Steven D'Aprano wrote: Reading the docs, I would expect that when using an int as seed, you should get identical results. That is similar to expecting

Re: help function and operetors overloading

2012-02-05 Thread Terry Reedy
) Help on built-in module operator: ... -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-05 Thread Terry Reedy
On 2/6/2012 1:53 AM, Chris Angelico wrote: On Mon, Feb 6, 2012 at 12:26 PM, Terry Reedy wrote: On 2/5/2012 6:23 PM, Dennis Lee Bieber wrote: On Mon, 6 Feb 2012 03:42:08 +1100, Alec Taylor wrote: A 4 year old compiler? I also have MSVC11 installed. Can the python project add support for

Re: Python and TAP

2012-02-06 Thread Terry Reedy
't care about joining the unittest 'standard'. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: convert perl-script for voltcraft voltmeter to python [newbie]

2012-02-06 Thread Terry Reedy
l $| = 1; # autoflush STDOUT while(1) { my ($nin, $in) = $port->read(255); print $in; } $port->close; -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: building a dictionary dynamically

2012-02-06 Thread Terry Reedy
On 2/6/2012 11:10 AM, noydb wrote: Adding to dictionaries just isn't obvious... if it's not dict.Add or dict.Appaned or the like, not obvious to inexperienced me! Have you read section 4.8-mapping types, of the library manual? Or help(dict) at the interactive prompt? -- Terry

Re: Cycle around a sequence

2012-02-07 Thread Terry Reedy
rt chain >>> a=range(10) >>> g = chain((a[i] for i in xrange(4, 10, 1)), (a[i] for i in xrange(4))) >>> for x in g: print x, ... 4 5 6 7 8 9 0 1 2 3 a=range(10) n = len(a) off = 4 for k in (a[(i+off) % n] for i in range(n)): print(a[k], end = ' ') -- Terry

Re: Cycle around a sequence

2012-02-08 Thread Terry Reedy
djustment: k = n - len(seq) while True: i = k while i < n: yield seq[i] i += 1 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Komodo 7 release (Python development tools)

2012-02-08 Thread Terry Reedy
m/komodo-edit is the page with the link people need to download just the editor. Does K.Edit let me run a program with one key, like F5 in IDLE? If so, does it leave me in interactive mode (python -i) as IDLE does? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: frozendict

2012-02-08 Thread Terry Reedy
ubtlety that I'm probably missing which is why it's not already provided. Does anyone know why Python doesn't already come with a frozendict, or why there seem to only be a couple attempts to write one? Turn the question around: why should there be? Python is intentionally parsim

Re: Id of methods

2012-02-08 Thread Terry Reedy
that it is not a 'function'. In Python 3, it will be, and have the same address. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode printing on Windows

2012-02-09 Thread Terry Reedy
all depends on what 'debugging' means to you. Important information : I am using Python 2.5 I don't know if IDLE was different then. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Read-only attribute in module

2012-02-09 Thread Terry Reedy
bugs, it is generally a 'consenting adults' language. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between @property and method

2012-02-09 Thread Terry Reedy
n.org/moin/AlternativeDescriptionOfProperty Suggested doc changes on the tracker get reviewed, and often applied. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Formate a number with commas

2012-02-09 Thread Terry Reedy
as in neither 2.6 nor 3.1. Both statements are completely technically correct, but misleading when not taken together. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Guide to: Learning Python Decorators

2012-02-09 Thread Terry Reedy
about 500 'locations'. The Kindle Users Guide, 3rd Ed., has 1300, Lao Tza, the Art of War, (project Gutenberg), aaabut 2100. I read about half in an hour. Even knowing the material, it is slower than a novel. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Read-only attribute in module

2012-02-09 Thread Terry Reedy
lass attributes. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: round down to nearest number

2012-02-09 Thread Terry Reedy
On 2/9/2012 8:23 PM, noydb wrote: So how would you round UP always? Say the number is 3219, so you want >>> (//100+1)*100 3400 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: frozendict

2012-02-09 Thread Terry Reedy
, not on dict creation. There have, however, been several variants suggested, and the focus has been on choosing one first for past and current versions. 3.3 is about 6 months off and hash for it may still be debated. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Read-only attribute in module

2012-02-10 Thread Terry Reedy
person in a multi-programmer project might decide to rebind xyz.flag and mess up everyone else. I think the real solution might be an option to freeze an entire module. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a debug version of Python 3.2.2 under Windows

2012-02-11 Thread Terry Reedy
ctive websites, or something else entirely? The readme file in PCBuild supposedly has all the info needed, though I know one thing out of date. Trying to follow the instructions is on my todo list ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric root-finding in Python

2012-02-12 Thread Terry Reedy
ansformed problem less sensitive to loss of significance; and begin by trying different numeric types to see if the problem is sensitive thereto to begin with. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python usage numbers

2012-02-12 Thread Terry Reedy
for Information Interchange. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

French and IDLE on Windows (was Re: Python usage numbers)

2012-02-12 Thread Terry Reedy
for the issue above I just found. So there is nothing obvious to fix. If you have a problem, give the specifics here and lets see if someone has a solution. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python usage numbers

2012-02-12 Thread Terry Reedy
On 2/12/2012 5:14 PM, Chris Angelico wrote: On Mon, Feb 13, 2012 at 9:07 AM, Terry Reedy wrote: The situation before ascii is like where we ended up *before* unicode. Unicode aims to replace all those byte encoding and character sets with *one* byte encoding for *one* character set, which will

Re: package extension problem

2012-02-13 Thread Terry Reedy
lass is in python, one might be able to just change the __class__ attribute. But I would make sure to have a good set of tests in any case. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: atexit.register in case of errors

2012-02-15 Thread Terry Reedy
which doesn't execute in case of errors? Have a single no-error normal exit point. if __name__ == '__main__': main() cleanup() if you really want to exit by exceptions rather than by returns, if __name__ == '__main__': try: main() except SystemExit: no

Re: Complexity question on Python 3 lists

2012-02-15 Thread Terry Reedy
On 2/15/2012 2:11 PM, Chris Rebert wrote: It's slightly more complex: http://hg.python.org/cpython/file/096b31e0f8ea/Objects/listobject.c "The growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 72, 88, …" -- list_resize() This has apparently changed from time to time. --

Re: Is this the right list?

2012-02-15 Thread Terry Reedy
list to ask? Go ahead. If the question is too specialized for readers here, you might get a suggestion where else to look. Include python versions on both systems and any tracebacks from executing the program. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-18 Thread Terry Reedy
t in many other countries. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as a default shell, replacement of bash, sh, cmd ?

2012-02-19 Thread Terry Reedy
ll affecting the global environment. The latter would trade the inconvenience of '()'s for the inconvenience of entering and exiting a special submode. I have not used IPYthon so I have no idea how close it gets to either of these. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: paper submission and versioning system - advice?

2012-02-20 Thread Terry Reedy
with accounts (which requires an authentication system). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Terry Reedy
ther the pep or the discussion around it says symlinks are fine now and the decision is up to distributors. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Does turtledemo in Python 3.2 actually work?

2012-02-24 Thread Terry Reedy
m this as a bug? http://docs.python.org/py3k/library/turtle.html#demo-scripts On Win7, all examples run fine except for one traceback with clock. http://bugs.python.org/issue14117 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: sum() requires number, not simply __add__

2012-02-24 Thread Terry Reedy
to do with None, and discovered this: import sys as None doesn't give an error, but also doesn't assign the module to the symbol 'None'. Weird. In 3.2 >>> import sys as None SyntaxError: invalid syntax -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python math is off by .000000000000045

2012-02-25 Thread Terry Reedy
decimal floats, substitute 10**n or more exactly, 2**j * 5**k since if J < k, n / (2**j * 5**k) = (n * 2**(k-j)) / 10**k and similarly if j > k. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python math is off by .000000000000045

2012-02-25 Thread Terry Reedy
irrelevant for computing. Since the number of finite strings is practically finite, so is the number of algorithms. And even a countable number of algorithms would be a fraction 0, for instance, of the uncountable predicate functions on 0, 1, 2, ... . So we do what we actually can that is of

Re: Question about circular imports

2012-02-26 Thread Terry Reedy
# choose the identifier you prefer -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-02-26 Thread Terry Reedy
h tags, perhaps automatically, so they know there is something new to go download. And indeed, there is something new to download. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python math is off by .000000000000045

2012-02-26 Thread Terry Reedy
tific calculation. 3. They better follow accounting rules for financial calculation, including a multiplicity of rounding rules. Some of these are laws that *must* be followed to avoid nasty consequences. This is the main reason for being in the stdlib. > Learning to use them is a

Re: Question about circular imports

2012-02-27 Thread Terry Reedy
__init__.py. @Terry and OKB I tried that, but it does not work. a.py /b __init__.py c.py d.py a.py - from b import c c.py - import b.d d.py - import b.c How about import b.d as d, etc? If I run a.py, it returns with no error. c.py - import b.d d = b.d

Re: alternative to with statement?

2012-02-28 Thread Terry Reedy
a.org/wiki/Resource_Acquisition_Is_Initialization Seems slightly odd to use just for creation... I do not see the point either. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension question

2012-02-29 Thread Terry Reedy
the rendered html, but in this case, the strong background colors make your post impossible for *me* to read. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-02-29 Thread Terry Reedy
ass App(Tk), class App(Frame) does not a .protocol attribute. See the tracker issue for all my comments on the example. I considered removing both the quit button and 'root.destroy' to get a beginning example that works properly, but as you said, having both is common so I would like both if the solution is not too esoteric. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-02-29 Thread Terry Reedy
nstead, tk surrounds the text with {bra ces}. This seems bizarre. Is there any way to have Button text with spaces and no braces? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed: dynamically pull data from different levels of a dict

2012-02-29 Thread Terry Reedy
;ifff-mtu-user-conf': '', 'internal-flags': '0x1000'}, 'address-family-name': 'mpls', 'mtu': '9174'},{'address-family-flags': {'ifff-none': ''}, 'address-family-name': 'multiservice', 'mtu': 'Unlimited'}], 'description': 'INFRA:CROSS:ASH-64CB-1B:GE-0/0/0.0:', 'encapsulation': 'ENET2', 'if-config-flags': {'iff-snmp-traps': ''}, 'local-index': '67', 'name': 'ge-0/0/0.0', 'snmp-index': '117', 'traffic-statistics': {'input-packets': '46367422526659','output-packets': '35670513402384','style': 'brief'}}, 'loopback': 'disabled', 'mtu': '9192', 'name': 'ge-0/0/0', 'oper-status': 'up', 'physical-interface-cos-information': {'physical-interface-cos-hw-max-queues': '8', 'physical-interface-cos-use-max-queues': '8'}, 'snmp-index': '116', 'source-filtering': 'disabled', 'speed': '10Gbps', 't raffic-statistics': {'input-bps': '4104358720', 'input-pps': '1059450', 'output-bps': '232358', 'output-pps': '537816', 'style': 'brief'}},} -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-02-29 Thread Terry Reedy
nflict with the user closing the window with the X button? See my other post of a few minutes ago for an example that now works. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Terry Reedy
On 3/1/2012 9:49 PM, Rick Johnson wrote: On Feb 29, 11:24 pm, Terry Reedy wrote: There is a minor problem left. The hi_there Button text has underscores because if I use spaces instead, tk surrounds the text with {bra ces}. This seems bizarre. Is there any way to have Button text with

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-02 Thread Terry Reedy
On 3/1/2012 10:43 PM, Terry Reedy wrote: Not sure what is happening on your end, but i don't see any braces. Are you saying that if you change "Hello_World\n(click_me)" to "Hello World\n(click me)", you see Hello World (click me) as I expected, instead of {Hellow W

Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"?

2012-03-02 Thread Terry Reedy
g the same name? > Or is that not possible? Will I have to use to separate names, like this: No. One name for one object. import tkinter as tk import tkinter.ttk as ttk Yes -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to write this regular expression?

2012-03-06 Thread Terry Reedy
stdlib. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to write this regular expression?

2012-03-06 Thread Terry Reedy
ce. I think the issue is the new interface. I am not seeing the double posting, but I use Thunderbird + the news.gmane.org mirrors of python-list and others. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-2.6.1 ctypes test cases failing

2012-03-07 Thread Terry Reedy
. Is there any available patch for this issue ?? There have been patches to ctypes since 2.6.1. At minimum, you should be using the latest version of 2.6. Even better, perhaps, would be the latest version of 2.7, since it contain patches applied after 2.6 went to security fixes only. -- Terry

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Terry Reedy
ndler or both) then it should not double-guess me and ignore the extra parameters. End-user applications may, with care, try to be smart and DWIM, but library functions should be dumb and should do what they are told. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.stdout.detach() results in ValueError

2012-03-07 Thread Terry Reedy
en if stdout is redirected. (You did not mention your OS.) You would have to open such a file and make sys.stdout point to it. sys.stdout = my_binary_file. But why do that? Just open the file and write to it directly without the above. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: what is best method to set sys.stdout to utf-8?

2012-03-07 Thread Terry Reedy
latter remains for back compatibility and whatever it can do that io cannot. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: stackoverflow question

2012-03-09 Thread Terry Reedy
Any ideas on how this can be accomplished? Rewrite the __init__ code object ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: stackoverflow question

2012-03-10 Thread Terry Reedy
try it in 'f' and dis again. Anything to do with code objects (and dis module) is implementation and version specific --- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-10 Thread Terry Reedy
platform allows. I understand your desire to promote Cython, but please stop resorting to FUD in doing so. You admitted it might be easier. Portability is plausible. So I think that a bit harsh. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >