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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
shes for strings either are or in 3.3 will
always be cached.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
ake self out of that
list.
Sets are much better for removal.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Yes. Yes.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
with ConfigObj.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
imperfect. I acknowledged that the transition will take years.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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.
--
y be
available through ActiveState's distribution."
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
PEP, if there is one, or the dicussion ( probably on pydev
list).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
.x, but even then, a mismatch between
encodings is a problem.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
=default):...
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
built with VS2010.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
)
Help on built-in module operator:
...
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
't care
about joining the unittest 'standard'.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
bugs, it is generally a 'consenting adults' language.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
lass attributes.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
, 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
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
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
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
for Information Interchange.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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.
--
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
t in many other countries.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
with accounts (which requires an authentication
system).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
# choose the identifier you prefer
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
__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
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
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
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
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
;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
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
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
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
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
stdlib.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
.
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
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
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
latter remains for back compatibility and whatever it can do that io cannot.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Any ideas on how this can be accomplished?
Rewrite the __init__ code object ;-).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
501 - 600 of 8120 matches
Mail list logo