if you're on Linux you should look
at valgrind.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
hat
Hendrik> there is far too much emphasis on doing things the quickest way
Hendrik> - as long as it works, and is fast enough, its not broken, so
Hendrik> don't fix it...
That's the rub. It wasn't fast enough. I only realized that had been a
problem once I fi
e you had to, or were asked to),
Hendrik> it became faster, and then, suddenly, retrospectively, it
Hendrik> became a problem
No, I think you misunderstand. I was poking around in that function for
other reasons, saw the "k in d.keys()" and realized that the wrong way
the OP is listening, I believe you can do this in a fairly
straightforward manner with SQLAlchemy.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
but implicitly
statically typed Python ...". Where does the static typing begin and end?
Can one module tweak another module's attributes? Can a class's attributes
be modified from outside the class? What about the attributes of a class
instance?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
s. Aside from
mail and web browsing, PySol is her number one application.
Harry> [PySol] should be considered a cultural treasure, and if a bit of
Harry> funding would help keep it rolling into the future, that might be
Harry> worthwhile.
Agreed, and +1 QOTW.
Skip
--
http://mai
vertigo> document.
vertigo> Can i force re to math as narrow as possible ?
http://docs.python.org/lib/re-syntax.html
Search for "greedy".
Skip
--
http://mail.python.org/mailman/listinfo/python-list
share for setting a default that leaves it open to
spammers.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
I could have sworn someone was working on a module recently with a
threading-like API that used subprocesses under the covers, but 10 minutes
or so of googling didn't yield anything. Pointers appreciated.
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ev/summary/2006-10-01_2006-10-15/#processes-and-threading-module-api
Thank you. Exactly what I was thinking of. I had even replied to the
thread!!!
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Why use the new module? Why not call __import__() or execfile()? Details
on their use are here:
http://docs.python.org/dev/lib/built-in-funcs.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ed that looks like:
Harold> X11 IPB = .32
Harold> X22 IPB = .45
...
This is a problem with a number of different solutions. Here's one way to
do it:
for line in open(filename, "r"):
fields = line.split()
print fields[0], "IPB =", f
> The correct fix would probably be to add methods to class
John> URLopener to control this; that's the usual way of handling
John> special URL opening situations.
The correct way would be to deal with it at the httplib level, then
percolate it up to urllib2. Urllib should probably not be extended any
further.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
John> If you're looking for a Summer of Code project, ...
I'm not. I'm about 25 years out of grad school. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
rrenaud> Is there a reason why erf() is not included in the math
rrenaud> package? According to the following URL it looks like it has
rrenaud> been standard C since 1999.
Python is implemented in the C89 dialect. Maybe Python 3.0 will be
implemented using C99.
Skip
David> Hi. Is anyone aware of any code to create a list of dependent
David> modules for a python module.
modulefinder: http://docs.python.org/lib/module-modulefinder.html
Added to Python in 2.3.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Helmut> I'd like to install a package ('rekall') which uses
Helmut> frame->f_nlocals which is no longer contained in frameobject.h.
Helmut> What's the recommended way to upgrade such an application?
I suspect PySequence_Length(frame->f_locals
Helmut> A personal question: Have you converted from Perl to Python, as
Helmut> well?
Never really needed to. Anybody hiring me for my Perl expertise would be in
big trouble. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
, string.letters[1::3], string.letters[2::3])
[('a', 'b', 'c'), ('d', 'e', 'f'), ('g', 'h', 'i'), ...
Obviously, if your lists are long, you can substitute itertools.izip for
zip. There's probably some easy way to achieve the same result with
itertools.groupby, but I'm out of my experience there...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
python.html
http://www.mail-archive.com/[email protected]/msg17806.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel> Where do you find the "What's new" for previous releases? I
Gabriel> have to read them online.
Google for
what's new site:python.org
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ou needed to read
them online because (perhaps) you don't have a source distribution on your
computer. My 2.5 source (Subversion sandbox) has 2.0 through 2.5 What's New
source in Doc/whatsnew.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ild_get_property
method and the list of child properties for gtk.Table children:
http://www.pygtk.org/docs/pygtk/class-gtkcontainer.html
http://www.pygtk.org/docs/pygtk/class-gtktable.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
python.org/view/*checkout*/python/tags/r236/Modules/_csv.c?content-type=text%2Fplain&rev=52574
http://svn.python.org/view/*checkout*/python/tags/r236/Lib/csv.py?content-type=text%2Fplain&rev=52574
Skip
--
http://mail.python.org/mailman/listinfo/python-list
w document for
version 2.3 (google for it) you;ll probably have a pretty good idea of any
such changes.
mohan> Otherwise upgrading to Python 2.4 would be the easiest choice.
Oh, you didn't mention that. By all means, upgrade to 2.4 or 2.5 instead of
trying to backport the csv module to
the
last yield.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Wolfgang> So basically if I want to write a long-running program in
Wolfgang> Python, it would make sense to code all functions that are
Wolfgang> likely to be called more than once as generators...
Skip> If they need to resume their calculations from where they left
>>> g.next()
4
>>> g.next()
4
>>> g.next(3)
Traceback (most recent call last):
File "", line 1, in
TypeError: expected 0 arguments, got 1
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Franck> My problem is that the errors comes from a function named
Franck> "wrapped" while I'd prefer to see here the name of the wrapped
Franck> function.
Take a look at
http://wiki.python.org/moin/PythonDecoratorLibrary
In particular, check out the De
>>>>> "Roy" == Roy Smith <[EMAIL PROTECTED]> writes:
Roy> There is much about traditional OO which translates well to Python,
Roy> but sometimes it is difficult to read a treatise on OO and tell
Roy> which bits are "traditional OO"
low literal newlines to be embedded in the string. Their presence is most
often detected in doc strings precisely for this reason.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
menu items that allow you to check just
comments and strings.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Roy> If you like Forth, take a look at PostScript.
I miss NeWS... :-(
Skip
--
http://mail.python.org/mailman/listinfo/python-list
02 2006 UTC (2 weeks, 6 days ago) by
gregory.p.smith
File length: 142926 byte(s)
Diff to previous 41922
backport of commit 42169
adds support for compiling against BerkeleyDB 4.4.x
Skip
--
http://mail.python.org/mailman/listinfo/python-list
So, to go backwards, just add "-1, -1, -1" to the range function in the
forward loop version.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ny> internal index.
Ronny> bar[] = 4.2. #Setting baz2 to 4.2
Sure. Check out the special method names for container types:
http://www.python.org/dev/doc/devel/ref/sequence-types.html
To index into instances of your class you need to define a __getitem__
method.
Skip
--
http
System (Linux).
Take a look at
http://sourceforge.net/projects/watch/
If you'd like to be added as a developer, let me know...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ready has a more-or-less functional user interface and support for
Windows.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
= 12100
... b = 12100
... c = 121*100
... print a is b
... print a is c
...
>>> f()
True
False
>>> print f.func_code.co_consts
(None, 12100, 121, 100)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
uld like to tackle something for
Python 2.5, I am sure a patch that Unicodifies the csv module would be
welcome.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
is
released I suspect there will be no difference.
If passing a long integer to some other routine is a problem (because it can
only accept regular integers) you can always convert it explicitly:
z = int(x)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
[[0, 0], [0, 0]]
>>> map(id, y)
[16988520, 16988520]
The object x refers to is a list with references to two other lists. The
object y refers to is a list with two references to the same list.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
to didn't disappear. (We could tell because it made connections to
another server which didn't disappear.) The solution was to recognize when
we where finished with it to set self.over_there to None. It would be nice
if Boost.Python knew how to play in the gc sandbox, but I suspect it
7;B'
TypeError: bad argument type for built-in operation
If the mod() method is defined in the base class it works properly. Is this
a Pyrex bug or am I not allowed to modify cdef'd attributes in subclasses?
(Note that I want Bar visible outside the module, hence no "cdef".)
Thanks,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
confuse myself will subscribe to the pyrex mailing
list (or at least use the somewhat clunky gmane.org interface).
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ojects/synergy2).
Someone, I thought from this list or maybe python-dev, told me about a newer
open source application in the same space which is more portable and
actively maintained/developed. Alas, I can't recall the name, nor can I
find it on my computer. Ring any bells?
Thx,
Skip
--
ht
So try the 2.4 version of calendar.py...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
tried commenting out the particular line (it's just
drawing a boundary between the left and right halves of the window, so I can
live without it). A later addstr call fails.
Any suggestions? Do I need to followup addstr with some sort of periodic
flush() call?
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
inted
out that out before. I stuck a couple asserts on the row and column
values. They didn't trip, the "addstr() returned ERR" tripped.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
second time the build_ext part should be fast.
Can anyone comment on the feasibility of this approach? I guess what I'm
wondering is what dependencies there are on the installation directory.
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
s the class callable.
In this particular case it was clearly unnecessary and just obfuscated the
code. I'm wondering, are there some general cases where __call__ methods of
a user-defined class are simply indispensable?
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
but know who is, please pass
this note along to them. If I've missed any other platforms (I know I must
have have missed something), let me know that as well.
Thanks,
--
Skip Montanaro - [EMAIL PROTECTED] - http://www.webfast.com/~skip/
--
http://mail.python.org/mailman/listinfo/python-list
'datetime.timedelta' and 'int'
>>> d.__div__(2)
datetime.timedelta(0, 43200)
When I run the interpreter under gdb's control with a breakpoint set in
delta_divide, the breakpoint is not reached in the first case, but it is in
the second. Is t
David> Connection details:
David>
http://wiki.python.org/moin/PyCon2008/OrganizersMeetingsConnectionDetails
Ah, now I remember. GAIM complained:
400: Malformed Jabber ID
GAIM recorded my Jabber ID as "[EMAIL PROTECTED]" which seems pretty
well-formed to me
require ncurses. It's an
add-on module which happens to be distributed with Python. The distutils
setup.py script checks for ncurses bits and indeed "plows ahead" if it's not
found. Not all systems (Windows, in particular) have ncurses.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
voiding regular expression hacks to extract the data
Chris> from this page?
Tidy it perhaps or use BeautifulSoup? ElementTree can use tidy if it's
available.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ckins on
1991-02-19, the last being r2314. The next checkin after that is on
1991-03-06. Since 0.9.1 was also released in February 1991, r2314 will
probably get you that version, or something very near to it.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
linuxaudiodev ossaudiodev spwd
Feel free to add comments to the above patch page. It will help the
development team decide whether or not it's a worthwhile addition.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
dateutil.parser import parse
>>> rule = rrule(DAILY, count=5, dtstart=parse("2006-03-12"))
>>> for d in rule:
... print d
...
2006-03-12 00:00:00
2006-03-13 00:00:00
2006-03-14 00:00:00
2006-03-15 00:00:00
2006-03-16 00:00:00
Skip
--
http://mail.python.org/mailman/listinfo/python-list
best chance of correct
operation will be to have the correct timezone tables installed on your
computer.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
from PEP 666:
The problem is that there is no polite way to say 'Stop wasting your
valuable time and mine.'
That's as politely as I can put it.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Bart> I'm sorry, but what's wrong with:
Bart> radix = [ [] ] * 256
Follow it up with:
print [id(e) for e in radix]
then you tell me what's wrong with it. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ree Network Group - go to
http://archives.free.net.ph/splash/index.en.html
select Python group and/or python-list mailing list and search for
utf8
As for RSS, try ASPN:
feed://listserv.activestate.com/rss/python-list-rss1.0.xml
I could keep going, but I'
Created:3-Dec-2001
Python-Version: 2.2
Post-History: 5-Dec-2001
Note the title and status.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
worker thread" pattern except
Paul> distributed across a network.
PyBrenda maybe? (Dunno if it's even still around.)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
e is going to be a
panacea.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ock the file... Is this
Slawomir> a bug in Python?
Kinda seems like it might be. Please file a bug report on SourceForge.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
>> When is it appropriate to use dict.items() vs dict.iteritems.
Laurent> Both work, you may prefer xrange/iteritems for iteration on
Laurent> large collections...
I find "iter" to be extremely ugly and hope to avoid using them
altogether until they are gone i
he
Drew> dict is large?
Sure, but I try hard to keep my dicts small. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Duncan> I think I'd prefer the barbaric:
Duncan>return len(list(iterator))
Duncan> since at least it is guaranteed to terminate.
Are you sure? There's no guarantee that an iterator will terminate:
len(list(itertools.cycle(range(10
Skip
--
htt
Jon> If I have a CSV reader that's passed to a function, is it possible
Jon> for that function to retrieve a reference to the "fileobj" like
Jon> object that was passed to the reader's __init__?
Nope, that isn't exposed from the C type.
Skip
Orin> I have a problem in using coverage.py module in my project:
You might want to contact Ned Batchelder, the author:
http://nedbatchelder.com/code/modules/coverage.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
x00\x03'
Andrés> I get an empty line, a '\n':
>>>>
>>>> _
Try
import struct
struct.pack('hhl', 1, 2, 3)
or
from struct import pack
pack('hhl', 1, 2, 3)
instead.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
then when using it you have to test line2 for None:
for n, (line1, line2) in enumerate(TwoLiner(open("file")):
print n, line1
if line2 is not None:
print line2
Skip
--
http://mail.python.org/mailman/listinfo/python-list
on. Whether or not the system actually
reclaims any memory from your process is dependent on the details of the
malloc/free implementation's details. That is, the behavior is outside
Python's control.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
long as you don't exhaust swap space).
Skip
--
http://mail.python.org/mailman/listinfo/python-list
sue (assuming Python for linux
Tom> and Python for windows are both compiled with GCC).
Sure, my apologies. The malloc/free implementation is strictly speaking not
part of the operating system. I tend to mentally lump them together because
it's uncommon for people to use a malloc/free implementation different than
the one delivered with their computer.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
n and aren't
just trying to recruit through traditional channels. You'd probably never
see job postings for the Space Telescope Science Institute or The World Wide
Workshop for Children's Media Technology and Learning if they only appeared
in the Washington Post or New York Times.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
gabriel> Is there something like a finally for unittest functions?
TestCase instances have setUp() and tearDown() methods:
http://docs.python.org/dev/lib/testcase-objects.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
r
Harlin> error name even though one is not specifically named?
>>> try:
... 1/0
... except Exception, err:
... print repr(err)
...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ere was some sort of wait() method in the threading module, but
I was mistaken. Maybe:
while threading.activeCount():
time.sleep(0.01)
?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
x==/usr/local you will wind up with
/usr/local/bin/python. There will also be a /usr/local/lib/pythonX.Y (with
structure underneath it) containing all the Python and extension modules.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
e working on solving the problem.
Thanks,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
jrpfinch> # Some other I/O problem, reraise error
jrpfinch> raise err
I'd just execute a bare raise (without err). That way the caller gets the
stack trace of the actual IOError.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
at is, be as precise as you can in the exceptions you catch. Also, try to
keep the body of the try block as small as you can.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
objects have timeout attributes now.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
gt; at speeds typical of JITs!
Woo hoo! Congratulations to all the PyPynistas!
Skip
--
http://mail.python.org/mailman/listinfo/python-list
hg> My issue with that is the effect on write: I only want a timeout on
hg> read ... but anyway ...
So set a long timeout when you want to write and short timeout when you want
to read.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
but i doubt it would help. Maybe not all of
your code, but a few lines of code around the suspect points.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
s wont be modified
Alex> since their creation.
Alex> Im very confused on how to work with the number easily.
Take a look at the dateutil module. Its relativedelta object has some
weekday sense:
http://labix.org/python-dateutil
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Max> Hey gang, I'm new to python coding. I'm trying to find the
Max> simplest way to open a text file (on the same server) and display
Max> it's content.
Try the open() builtin function:
f = open(plainfiles.href, "r")
print f.read()
Skip
LRU cache package to the Python
Evan> Package Index:
Evan> http://www.python.org/pypi?:action=display&name=lrucache&version=0.2
Couldn't get to your website, but I've been using this one I wrote for
several years:
http://www.webfast.com/~skip/python/Cache.py
Evan> http://www.python.org/pypi?:action=display&name=lrucache&version=0.2
skip> Couldn't get to your website, but I've been using this one I wrote
skip> for several years:
skip> http://www.webfast.com/~skip/python/Cache.py
skip> I
Kevin> I was just looking at the new MacPython pages at the Python
Kevin> wiki--it appears nothing has been done with them since Skip moved
Kevin> them over. I'm thinking this is a terrific opportunity to bring
Kevin> them up to date: would anyone mind if I got s
advantage of the
compiler's optimization facilities.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Steve> The only way to do this is to have the thread regularly examine a
Steve> "please quit" flag that is set from the main thread when
Steve> termination is required.
I thought the process would terminate when only daemon threads were left.
Skip
--
http://mail
Steve> Maybe, then, the real answer is "just exit from the main thread"?
Yes, I believe so. If that's not what's happening I would look to see if
there is another thread which wasn't marked as a daemon.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
han what you stated above:
Heaps are arrays for which heap[k] <= heap[2*k+1] and heap[k] <=
heap[2*k+2] for all k, counting elements from zero.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
skip> Check the heapq docs for the constraints the Python heapq module
skip> maintains:
s/constraints/invariants/
Skip
--
http://mail.python.org/mailman/listinfo/python-list
were the same as those
maintained by Python's heapq module.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 2037 matches
Mail list logo