to get some experience with it first. Try it out and report back.
The SourceForge forum for the project is the best place to report problems.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation
to know.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
This has me completely mystified. Some SELECT operations performed through
MySQLdb produce different results than with the MySQL graphical client.
This failed on a Linux server running Python 2.5, and I can reproduce it
on a Windows client running Python 2.4. Both are running MySQL 2.5.
The
Carsten Haese wrote:
On Mon, 2008-02-04 at 11:30 -0800, John Nagle wrote:
Restarting the MySQL instance changes the database. The entry google.com
disappears, and is replaced by www.google.com. This must indicate a
hanging
transaction that wasn't committed.
But that transaction didn't
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
John Nagle wrote:
Carsten Haese wrote:
On Mon, 2008-02-04 at 11:30 -0800, John Nagle wrote:
Restarting the MySQL instance changes the database. The entry
google.com
disappears, and is replaced by www.google.com. This must indicate
a hanging
transaction that wasn't
.
The real optimization trick for Python is figuring out at compile time what
might change at run time, and what won't be. Then all the things that
can't change can be hard-bound during compilation. Shed Skin does
some of that.
John Nagle
--
http
Paul Boddie wrote:
On 4 Feb, 20:30, John Nagle [EMAIL PROTECTED] wrote:
This has me completely mystified. Some SELECT operations performed
through
MySQLdb produce different results than with the MySQL graphical client.
This failed on a Linux server running Python 2.5, and I can reproduce
of the language, but late-binding everything kills
performance.
Shed Skin has restrictions like that, but Shed Skin is being
developed by one guy, which isn't much for an optimizing compiler.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
recognized by the FPU, except maybe underflow. If you're doing
such serious number-crunching that you really want to handle NANs,
you're probably not writing in Python anyway.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Preston Landers wrote:
Hey guys and gals. What are all the cool kids using these days to
document their code?
HTML. Text-only docs are so last-cen.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
compile time. The run-time environment is a tree of hashes.
The resulting implementation will be slow, but then, so is CPython.
Too much time goes into hash lookups.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
unless the first process has been completed...
unlocking the tables. Bear in mind that you can only have one
cursor per database connection. The MySQLdb API makes it look
like you can have multiple cursors, but that doesn't actually
work.
John Nagle
--
http
something with commas, and it's not
clear why.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
vedranp wrote:
I would like to avoid the step of taking data out from database in
order to process it.
You can probably do this entirely within SQL. Most SQL databases,
including MySQL, will let you put the result of a SELECT into a new
table.
John Nagle
a language extension.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae'
in position 46: ordinal not in range(128)
Should attributes be restricted to ASCII, or is this a bug?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
On Mar 14, 5:38 am, John Nagle [EMAIL PROTECTED] wrote:
Just noticed, again, that getattr/setattr are ASCII-only, and don't
support
Unicode.
SGMLlib blows up because of this when faced with a Unicode end tag:
File /usr/local/lib/python2.5/sgmllib.py, line
doesn't seem to do anything not previously possible; it's just different.
Back when I was doing program verification work, we used to refer to
stuff like that as the logic of the month club.
John Nagle
--
http://mail.python.org/mailman/listinfo/python
What's the cheapest way to test for an empty dictionary in Python?
if len(dict.keys() 0) :
is expensive for large dictionaries, and makes loops O(N^2).
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Brian Lane wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
John Nagle wrote:
What's the cheapest way to test for an empty dictionary in Python?
if len(dict.keys()) :
is expensive for large dictionaries, and makes loops O(N^2).
John
Bryan Olson wrote:
D'Arcy J.M. Cain wrote:
John Nagle wrote:
What's the cheapest way to test for an empty dictionary in Python?
Try this:
if dict:
D'Arcy is right; that's the way to go. I'll add that 'dict' is the name
of the built-in class, so an instance is usually best
with the garbage problem.
What are you parsing? If you're parsing well-formed XML,
BeautifulSoup is overkill. If you're parsing real-world HTML,
ElementTree is too brittle.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
of the notation
objectinstance.attributename
If you're only going to get the attributes with getattr, they
don't need to be attributes.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
John Nagle [EMAIL PROTECTED] writes:
Fast cgi is a good technology, but it's not well documented or
well supported. For some reason, the Apache people don't like it.
It used to be part of the Apache distribution, but that ended years ago.
It seems to be coming back
architect their systems like this?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Heiko Wundram wrote:
Am Mittwoch, 26. März 2008 18:54:29 schrieb Michael Ströder:
Heiko Wundram wrote:
Am Mittwoch, 26. März 2008 17:33:43 schrieb John Nagle:
I didn't say it was unusual or frowned upon (and I was also taught this at
uni
IIRC as a means to easily distribute systems which
fields = map(lambda(s) : s.strip(), fields) # strip whitespace
tcLst.append(TestCase(fields[0], fields[1:])) # pcap, then sids
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
that.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
of numbers from 0 to n. For
example, upTo(3) should return the list [0, 1, 2, 3].
def howmany(n) :
return(range(n+1))
That should get you started.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
recommend using Java or C# for new work in this area
if you're doing this in volume. Otherwise, you'll need to buy
many, many extra racks of servers. In practice, the big spiders
are in C or C++.
http://www.immavista.com
Lose the ad link.
John Nagle
facilities are already working.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
need to do
connection.commit()
after updating.
In general, server side programs should have a try-block
wrapped around most of the program, with some code to display or
log errors in some useful way.
John Nagle
--
http://mail.python.org/mailman
for mythread in mythreads: # for all threads
mythread.join() # wait for thread to finish
totalcount += mythread.result # add to result
print Total size of all tables is:, totalcount
John
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Gerardo Herzig wrote:
John Nagle wrote:
Gerardo Herzig wrote:
Thanks John, that certanly works. According to George's suggestion, i
will take a look to the Queue module.
One question about
for mythread in mythreads:# for all threads
mythread.join()# wait
in a few records, and
try various SELECT statements. That will give you a sense of how SQL works.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
when the parent terminates?
Thank you.
Put a thread in the child which reads stdin, and make stdin
connect to a pipe from the parent. When the parent terminates,
the child will get a SIGPIPE error and raise an exception.
John Nagle
--
http://mail.python.org
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
files.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
solution, especially when they reserve the right
to start charging.
Their data store uses a subset of SQL, so it's probably possible
to write a conversion layer allowing use of MySQL.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
on a
revision of C++ since the 1990s, and that hasn't happened either.
The general consensus is that Python 3.x isn't much of an
improvement over the existing language. There's just not much
demand for it.
John Nagle
--
http://mail.python.org/mailman/listinfo
problem.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
is ideological; mixing them is a bug.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
created threads in a
program are finished before the main program exits?
I guess I'm doing something wrong with join().
Didn't we answer this question just a few days ago?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
your data structures need garbage collection? CPython is
a reference counted system with garbage collection as a backup
to catch cycles. Try using weak back-pointers in your data
structures to avoid creating cycles.
John Nagle
--
http://mail.python.org/mailman
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
If you really want to update files in place, use a database, like
SQLite. If you find yourself rewriting big files for minor changes,
switch to a database. For small files, just rewrite the whole thing.
John Nagle
--
http://mail.python.org/mailman/listinfo
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
be immutable constants only.
There's been talk of fixing this (it's really a design bug in Python),
but for now, it's still broken.
(I just had horrible thoughts about the implications of binding
a closure to a default argument. You don't want to go there.)
John Nagle
attempt:
easy_install usually seems to make things harder.
BeautifulSoup is one single .py file. That's all you need.
Everything else is excess baggage.
John Nagle
SiteTruth
--
http://mail.python.org
have 2.5?
Desktop or server?
If server, check what the major Linux distros, like Fedora
Core, are shipping with.
Check major shared hosting providers to see what they're offering
to their customers as standard.
John Nagle
--
http
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Tim Golden wrote:
John Nagle wrote:
Mike Driscoll wrote:
Ken,
On Tue, Apr 22, 2008 at 1:36 PM, Kenneth McDonald
[EMAIL PROTECTED] wrote:
Sadly.
Thanks,
Ken
--
http://mail.python.org/mailman/listinfo/python-list
I've attached the 2.4 version. I also have some Windows binaries
under
a mountain of mediocre libraries.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
, no standard installation, no
standard uninstallation, and no standard version control.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
the temptation to guess.
Greg
Good point.
The problem is the typical one; Python did not originally
have a Boolean type, and the retrofit resulted in weird semantics.
C has the same issue.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
to use weak pointers.
All the pointers towards the root and towards previous parts of the
document are weak. As a result, reference counting alone is sufficient
to manage the tree. We still keep GC enabled, but it doesn't find much
to collect.
John Nagle
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
without checking with the underlying OS
to see if the file exists.
If, say, you're writing a GUI tool for setting up some configuration,
you'd want to do input validation on fields without actually
accessing the files.
John Nagle
--
http://mail.python.org/mailman
on the queue. get() blocks until there's work to do.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
is naive. That sort of thing should be a
compile-time optimization.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
)
And we're downhill from there. Probably worth fixing, since it's one of the
few real-world HTML bugs that totally blows up BeautifulSoup.
John Nagle
SiteTruth
--
http://mail.python.org/mailman/listinfo/python-list
real-world
HTML.
A try-block in handle_charref would be appropriate.
John Nagle
SiteTruth
--
http://mail.python.org/mailman/listinfo/python-list
complicated a lot of things.
Regards,
Martin
No, it's broken. PEP 3137 says one thing, and the 2.6 implementation
does something else. So code written for 2.6 won't be ready for 3.0.
This defeats the supposed point of 2.6.
John Nagle
--
http
with embedded Python code.
Now there's an example of exactly what exec and eval shouldn't be used for.
You don't put general-purpose execution mechanisms into your web site
template system. That's just asking for trouble.
John Nagle
--
http://mail.python.org
this. The Javascript actually
has to be run before you get anything.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
on the XPath functions. This
could be due to an error in the parsing, or it could be due to an admin
changing the site (removing/adding courses etc...)
What URLs are you looking at?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
those pages of JSON over and
over and get the same data every time.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
option if you're doing something that doesn't work
like a typical web application.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
as a syntax error. (Whether to use
tabs or spaces is a religious argument, but mixing them is clearly
wrong, and results in non-visible bugs. CPython should enforce
that.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
. In COBOL, one writes
PICTURE $999,999,999.99
which is is way ahead of most of the later approaches.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Any idea when PyWin32 will be available for Python 3.x?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
of correctness. Today, of course,
buffer overflows are a way of life.
This is really off topic for the group.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Tim Golden wrote:
John Nagle wrote:
Any idea when PyWin32 will be available for Python 3.x?
John Nagle
Release 213 is out already:
http://sourceforge.net/project/showfiles.php?group_id=78018package_id=79063release_id=661475
I think it's still considered a little bit
Tim Golden wrote:
John Nagle wrote:
That wizard won't even install unless Python 3.0 is in the
registry, which apparently means installed as the default Python.
No, it just means installed somewhere. I have 6 different
versions of Python installed on this box. The choice of
which
Tim Golden wrote:
John Nagle wrote:
Well, of some other packages I use:
MySQLdb: Python versions 2.3-2.5 are supported.
Ref: http://sourceforge.net/projects/mysql-python
M2Crypto: Latest version is for Python 2.6.
Ref: http://chandlerproject.org/bin/view/Projects
.
Python originally had only reference counting, and didn't have weak pointers.
If weak pointers had gone in before the garbage collector, Python might have
gone in this direction.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
come back.
So you can't actually trust those fields, and have to back them up with
checks of your own if you want exactly one copy of each item. It's
something that feedparser should perhaps do.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
back pressure?
Do Linux sockets have back pressure?
Yes, and yes.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Jean-Paul Calderone wrote:
On Tue, 24 Mar 2009 22:20:49 -0700, John Nagle na...@animats.com wrote:
Jean-Paul Calderone wrote:
On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood
n...@craig-wood.com wrote:
Jean-Paul Calderone exar...@divmod.com wrote:
[snip]
After bringing in all the heavy
can be sure
there won't be any paging. Then make sure you've gotten rid of
anything unwanted running in the background (always a headache
on Windows), and crank up the priority of your real-time task.
And put in a hardware stall timer.
John Nagle
--
http
that the rest of the file has a non-ASCII encoding,
and restart the parse from the beginning. BeautifulSoup has the
machinery for that.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
performance.
And none of the usual debugging tools for Python will help you.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
of dealing with devices which may be
turned off and on or which may not send when wanted.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
join.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
. Also, the CSV module doesn't do
Unicode well as yet. Make sure the outcsv object
goes out of scope before you try to read the file, so the
file gets flushed and closed.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
database handle, so if you have
multiple database handles, each needs to handle its own COMMIT needs.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
faced with a site that wants authentication
is to to ask for a user name and password on standard input. This is
seldom what you want.
So subclass and overrride.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
to do, anyway? What's the application?
You probably don't want to use eval that way. If you want function
objects out, use compile.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
actually hit it parsing big HTML
files with BeautifulSoup.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
standard, unfortunately.
So it's not definitively a bug.
John Nagle
SiteTruth
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 1305 matches
Mail list logo