I've had much success doing round trips through the lxml.html parser.
https://lxml.de/lxmlhtml.html
I ditched bs for lxml long ago and never regretted it.
If you find that you have a bunch of invalid html that lxml inadvertently
"fixes", I would recommend adding a stutter-step to your project: p
On Thu, Feb 11, 2021 at 1:49 PM dn via Python-list
wrote:
> When I first met it, one of the concepts I found difficult to 'wrap my
> head around' was the idea that "open software" allowed folk to fork the
> original work and 'do their own thing'. My thinking was (probably)
> "surely, the original
Received?
On Sun, Sep 16, 2018 at 3:39 PM Buck Evan wrote:
> I started to send this to python-ideas, but I'm having second thoughts.
> Does tihs have merit?
>
> ---
> I stumble on this a lot, and I see it in many python libraries:
>
> def f(*args, **kwargs):
> .
I started to send this to python-ideas, but I'm having second thoughts.
Does tihs have merit?
---
I stumble on this a lot, and I see it in many python libraries:
def f(*args, **kwargs):
...
f(*[list comprehension])
f(**mydict)
It always seems a shame to carefully build up an object in order
It used to be that the best way to compare floating point numbers while
disregarding the inherent epsilon was to use `str(x) == str(y)`. It looks like
that workaround doesn't work anymore in 3.4.
What's the recommended way to do this now?
>>> format(.01 + .01 + .01 + .01 + .01 + .01, 'g') == fo
On Sunday, January 19, 2014 12:19:29 AM UTC-8, Ian wrote:
> On Sat, Jan 18, 2014 at 10:40 PM, buck wrote:
>
> > I'm trying to work through Skienna's algorithms handbook, and note that the
> > author often uses graphical representations of the diagrams to help
&g
I'm trying to work through Skienna's algorithms handbook, and note that the
author often uses graphical representations of the diagrams to help understand
(and even debug) the algorithms. I'd like to reproduce this in python.
How would you go about this? pyQt, pygame and pyglet immediately come
On Friday, November 16, 2012 4:33:14 PM UTC-8, Nobody wrote:
> On Fri, 16 Nov 2012 13:44:03 -0800, buck wrote:
> IOW: Microsoft's "embrace, extend, extinguish" strategy has been too
> successful and now we have to deal with it. If HTML content is tagged as
> using ISO-88
On Friday, November 16, 2012 2:34:32 PM UTC-8, Ian wrote:
> On Fri, Nov 16, 2012 at 2:44 PM, wrote:
>
> > Latin1 has a block of 32 undefined characters.
>
>
> These characters are not undefined. 0x80-0x9f are the C1 control
> codes in Latin-1, much as 0x00-0x1f are the C0 control codes, and
>
Latin1 has a block of 32 undefined characters.
Windows-1252 (aka cp1252) fills in 27 of these characters but leaves five
undefined: 0x81, 0x8D, 0x8F, 0x90, 0x9D
The byte 0x81 decoded with latin gives the unicode 0x81.
Decoding the same byte with windows-1252 yields a stack trace with
`UnicodeDec
On Feb 23, 1:32 pm, Chris Rebert wrote:
> On Thu, Feb 23, 2012 at 1:19 PM, Buck Golemon wrote:
> > I feel like the design of sum() is inconsistent with other language
> > features of python. Often python doesn't require a specific type, only
> > that the type
On Feb 23, 1:19 pm, Buck Golemon wrote:
> I feel like the design of sum() is inconsistent with other language
> features of python. Often python doesn't require a specific type, only
> that the type implement certain methods.
>
> Given a class that implements __add__ why shou
I feel like the design of sum() is inconsistent with other language
features of python. Often python doesn't require a specific type, only
that the type implement certain methods.
Given a class that implements __add__ why should sum() not be able to
operate on that class?
We can fix this in a bac
This is what I came up with:
https://gist.github.com/1496028
We'll see if it helps, tomorrow.
On Sunday, December 18, 2011 6:01:50 PM UTC-8, buck wrote:
> Thanks Jack. I think printf is what it will come down to. I plan to put a
> little code into PyDict_New to print the id and
r unit tests on and off to pinpoint where
> the refcounts are getting messed up. It also causes python to use
> plain malloc()s so valgrind becomes useful. Worst case add assertions
> and printf()s in the places you think are most janky.
>
> -Jack
>
> On Sat, Dec 17, 2011 a
On Saturday, December 17, 2011 11:55:13 PM UTC-8, Paul Rubin wrote:
> buck writes:
> > I tried to pinpoint this intermediate allocation with a similar
> > PyDict_New/LD_PRELOAD interposer, but that isn't working for me[2].
>
> Did you try a gdb watchpoint?
I didn'
head, @tuple tail = sequence
def foo(@list args, @dict kwargs): pass
foo(@args, @kwargs)
For backward compatibility, we could say that the unary * is identical to @list
and unary ** is identical to @dict.
-buck
--
http://mail.python.org/mailman/listinfo/python-list
I'm getting a fatal python error "Fatal Python error: GC object already
tracked"[1].
Using gdb, I've pinpointed the place where the error is detected. It is an
empty dictionary which is marked as in-use. This is somewhat helpful since I
can reliably find the memory address of the dict, but it d
This is what made me choose Mercurial in my recent search.
http://www.python.org/dev/peps/pep-0374/
There is a tremendous amount of detail there. In summary, hg and git are both
very good, and essentially equal in features. The only salient difference is
that hg is implemented in python, so th
and
you can post it to bitbucket and share with the world if you like, almost as
easily.
--Buck
--
http://mail.python.org/mailman/listinfo/python-list
I'm not not touching you!
--
http://mail.python.org/mailman/listinfo/python-list
I've been having issues with getting a file-like object to work with
multiprocessing. Since the details are quite lengthy, I've posted them on
stackoverflow here:
http://stackoverflow.com/questions/5821880/python-multiprocessing-synchronizing-file-like-object
I hope I'm not being super rude by
On Oct 13, 9:37 am, Ethan Furman wrote:
> Buck wrote:
> >I'd like to get to zero-installation if possible. It's easy with
> >simple python scripts, why not packages too? I know the technical
> >reasons, but I haven't heard any practical reasons.
>
&g
On Oct 12, 3:34 pm, "Gabriel Genellina"
wrote:
> En Mon, 12 Oct 2009 15:24:34 -0300, Buck escribió:
>
> > On Oct 10, 9:44 am, "Gabriel Genellina"
> > wrote:
> >> The good thing is that, if the backend package is properly installed
> >>
On Oct 12, 4:30 pm, Carl Banks wrote:
> On Oct 12, 11:24 am, Buck wrote:
>
> > On Oct 10, 9:44 am, "Gabriel Genellina"
> > wrote:
>
> > > The good thing is that, if the backend package is properly installed
> > > somewhere in the Python path ..
e. To fix
this, I might make a packagehelper module or some such, but as soon as
I start organizing my scripts into a hierarchy (the topic of the OP),
I have a catch 22 in that packagehelper is a module that helps me find
modules. This means I need a copy of packagehelper in each script
dire
On Oct 10, 9:44 am, "Gabriel Genellina"
wrote:
> The good thing is that, if the backend package is properly installed
> somewhere in the Python path ... it still works with no modifications.
I'd like to get to zero-installation if possible. It's easy with
simple python scripts, why not packages
On Oct 5, 8:12 pm, Steven D'Aprano
wrote:
> The Original Poster is confusing installation difficulties with code
> organization -- his problem is that users have special requirements for
> installation, and he's trying to work around those requirements by
> organizing his code differently.
I beli
On Oct 5, 2:15 pm, "Rami Chowdhury" wrote:
> On Mon, 05 Oct 2009 13:46:09 -0700, Buck wrote:
> > Thanks. I think we're getting closer to the core of this.
>
> > To restate my problem more simply:
>
> > My core goal is to have my scripts in some sor
use it again because it was
too complicated. I could fix the error message to tell them exactly
what to do, but at that point I might as well re-write the above
boilerplate code.
I'm overstating my case here for emphasis, but it's essentially true.
--Buck
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 5, 11:29 am, Robert Kern wrote:
> On 2009-10-05 12:42 PM, Buck wrote:
>
>
>
> >> With the package layout, you would just do:
>
> >> from parrot.sleeping import sleeping_in_a_bed
> >> from parrot.feeding.eating import eat_cracker
>
>
>
> With the package layout, you would just do:
>
> from parrot.sleeping import sleeping_in_a_bed
> from parrot.feeding.eating import eat_cracker
>
> This is really much more straightforward than you are making it out to be.
>
As in the OP, I need things to "Just Work" without installation
r
I use MySQLdb quite a bit in my work. I could volunteer to help update
it. Are there any particular bugs we're talking about or just a
straight port to 3.0?
--Buck
On Jul 31, 6:32 pm, John Nagle wrote:
> Any progress on updating feedparser and MySQLdb for Python 3.x in the
>
I've been trying to install Mailman, which requires a newer version
of the Python language compiler (p-code generator?) than the one I
currently have on my linux webserver/gateway box.
It's running a ClarkConnect 2.01 package based on Red Hat 7.2 linux.
I downloaded the zipped tarball (Python-
I've been trying to install Mailman, which requires a newer version
of the Python language compiler (p-code generator?) than the one I
currently have on my linux webserver/gateway box.
It's running a ClarkConnect 2.01 package based on Red Hat 7.2 linux.
I downloaded the zipped tarball (Python-2
ive, just wait and see what this guys finds:
http://sql-info.de/mysql/gotchas.html
BTW, you should upgrade, they're now on 5.0.3. Their support site
appears to be down right now (timeouts) so I can't check the new bug
list, but since 5.0.2 is beta, it may have introduced more prob
one of their reps.
Bottomline - mysql has a lot of marketshare, is improving, and I'm sure
that it'll eventually be a credible product. But right now it's has a
wide range of inexcusable problems.
More info at http://sql-info.de/mysql/gotchas.html
buck
--
http://mail.python.org/mailman/listinfo/python-list
. Maybe something from the 70s like IMS-DB or Model 204?
buck
--
http://mail.python.org/mailman/listinfo/python-list
38 matches
Mail list logo