Re: Python script to optimize XML text

2007-09-25 Thread Stefan Behnel
that you can provide a DTD to tell it what whitespace-only content really is "useless" in the sense of your specific application. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-25 Thread Stefan Behnel
uot;file descriptor" under Unix is not necessarily an open file that you can find on the hard-disk. It might also be a socket connection or a pipe, or it might be a file that was opened or created with specific rights or in an atomic step (like temporary files). Many things are (or look lik

Re: Inserting an element into existing xml file

2007-09-25 Thread Stefan Behnel
ee, which you can also install on Python 2.4 (it's what later became part of Python 2.5). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python XML API's that preserve XML comments?

2007-09-26 Thread Stefan Behnel
u can have a fallback to the stdlib if lxml is not installed (though this will loose comments then). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: elementtree question

2007-09-26 Thread Stefan Behnel
other one is the standard API of the "list" builtin type, which has an extend() method. ah-you're-just-jealous-we-had-it-first-ly, Stefan :) -- http://mail.python.org/mailman/listinfo/python-list

Re: elementtree question

2007-09-26 Thread Stefan Behnel
uot; of automatically removing an Element from the old position when inserting it at a different place. ElementTree does not do that, so this code is not portable between the two libraries. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the value out of a DOM Element

2007-09-27 Thread Stefan Behnel
ernatively, try an XML API that makes it easy to handle XML, like ElementTree (part of the stdlin in Python 2.5) or lxml, both of which have compatible APIs. The code would look like this: tree = etree.parse("some_file.xml") id = tree.find("//LLobjectID") print id.text Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the value out of a DOM Element

2007-09-27 Thread Stefan Behnel
kj7ny wrote: > Forgot to mention I'm using Python 2.4.3. You can install both lxml and ET on Python 2.4 (and 2.3). It's just that ET went into the stdlib from 2.5 on. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: List search

2007-09-28 Thread Stefan Bellon
st compare for equality: if line == 'x11': or print "\n".join(x for x in mylist if x == 'x11') -- Stefan Bellon -- http://mail.python.org/mailman/listinfo/python-list

Is there a nicer way to do this?

2007-10-04 Thread Stefan Arentz
Is there a better way to do the following? attributes = ['foo', 'bar'] attributeNames = {} n = 1 for attribute in attributes: attributeNames["AttributeName.%d" % n] = attribute n = n + 1 It works, but I am wondering if there is a more pythonic way to do this. S. -- http://mail.python.o

Re: Is there a nicer way to do this?

2007-10-04 Thread Stefan Arentz
Stefan Arentz <[EMAIL PROTECTED]> writes: > Is there a better way to do the following? > > attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: >attributeNames["AttributeName.%d" % n] = attribu

Re: Create a string array of all comments in a html file...

2007-10-06 Thread Stefan Behnel
? from lxml import etree parser = etree.HTMLParser() tree = etree.parse("somefile.html", parser) print tree.xpath("//comment()") http://codespeak.net/lxml Stefan -- http://mail.python.org/mailman/listinfo/python-list

Accessing 'Package Data'

2007-10-09 Thread Stefan Arentz
At http://docs.python.org/dist/node12.html it is described how to add package data to a module. This was pretty easy to do, but now how do I access this data from my module? Is there an API to load a 'package resource' ala Java's classloader? S. -- http://mail.python.org/mailman/listinfo/python

Re: Python and UML

2007-10-09 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > On 9 Okt, 12:15, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> IMHO UML is ... crap, at least when it comes to actual developing. > > What alternatives are there? What's your use case? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Lamaizm... XML problem...

2007-10-09 Thread Stefan Behnel
ldren of t_prop to find the text node and then read its nodeValue. Alternatively, consider using an XML library that actually helps users in working with XML, such as ElementTree or lxml. http://codespeak.net/lxml Stefan -- http://mail.python.org/mailman/listinfo/python-list

Mixing Python and C classes in a module

2007-10-09 Thread Stefan Arentz
Is it possible to mix classes defined in both Python and C in the same module? Ideally I would like to be able to do: from some.module import MyPythonClass, MyCClass I guess that would mean that this would look like this on disk: some/ __init__.py module.py (contains MyPythonClass)

Native class methods

2007-10-09 Thread Stefan Arentz
Is there an easy way to implement a specific method of a Python class in C? Like a native method in Java? I would really like to do the majority of my class code in Python and just do one or two methods in C. S. -- http://mail.python.org/mailman/listinfo/python-list

Re: Native class methods

2007-10-09 Thread Stefan Arentz
"Chris Mellon" <[EMAIL PROTECTED]> writes: > On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is there an easy way to implement a specific method of a Python class > > in C? Like a native method in Java? I would really like

Re: Unexpected behaviour with HTMLParser...

2007-10-10 Thread Stefan Behnel
l.html. http://codespeak.net/lxml/dev/lxmlhtml.html It's part of lxml 2.0, which is currently in alpha status (which does not mean it's unstable or something, just not as complete as its authors want it to be). http://codespeak.net/lxml/dev/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: pyxml package not working? No xml.dom.ext.reader module available after install.

2007-10-10 Thread Stefan Behnel
able, eventhough the folder, __init__py > and everything is in place. > > Why? And could someone please make a win32-binary package of pyxml for > python2.5? Thanks! PyXML has not been actively maintained for some years now. Use ElementTree or lxml instead. http://codespeak.net/lxml S

Re: pyxml package not working? No xml.dom.ext.reader module available after install.

2007-10-10 Thread Stefan Behnel
Thomas W wrote: > On 10 Okt, 11:13, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Thomas W wrote: >>> I've tried to install the pyxml-package, available >>> athttp://pyxml.sourceforge.net/, >>> both from source and using some hack on the win32-binary p

Re: Last iteration?

2007-10-12 Thread Stefan Behnel
for item in l[1:]: print next next = item print next * next Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's coming... from unexpected angles.

2007-10-16 Thread Stefan Behnel
er here. They do not pronounce "Monty Python" the way you'd think they do, so the above isn't actually of any help at all. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Parser for Jython

2007-10-17 Thread Stefan Behnel
Falcolas wrote: > Does anybody know of a decent HTML parser for Jython? I have to do > some screen scraping, and would rather use a tested module instead of > rolling my own. Not sure if it works, but have you tried BeautifulSoup? Or maybe an older version of it? Stefan

Building sparc64 32/64-bit Python

2007-10-22 Thread Stefan Bellon
the 64-bit library in a sparcv9 directory but shares the other Python libraries that are ELF-code independent. Is this possible or do I really have to install two complete but separate Pythons although most of the files are the same? -- Stefan Bellon -- http://mail.python.org/mailman/listinfo/python-list

Re: Building sparc64 32/64-bit Python

2007-10-22 Thread Stefan Bellon
On Mon, 22 Oct, Diez B. Roggisch wrote: > Stefan Bellon wrote: > > I can successfully build a 32-bit version in one directory and a > > 64-bit version in another directory. What I'd like to do is to > > build a version that has the 64-bit library in a sparcv9 director

Re: ignoring chinese characters parsing xml file

2007-10-22 Thread Stefan Behnel
m.tag , elem.attrib["name"],elem.attrib["url"], The problem is the print statement. Looks like your terminal encoding (that Python needs to encode the unicode string to) can't handle these unicode characters. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python project ideas

2007-10-25 Thread Stefan Behnel
Evan Klitzke wrote: > but you could also write your own templating engine for this. No, please. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python project ideas

2007-10-25 Thread Stefan Behnel
Arnaud Delobelle wrote: > On Oct 25, 10:05 am, Stefan Behnel <[EMAIL PROTECTED]> > wrote: >> Evan Klitzke wrote: >>> but you could also write your own templating engine for this. >> No, please. > > I'm afraid it is the inalienable right of every pytho

Re: elementtree w/utf8

2007-10-28 Thread Stefan Behnel
setup.py install. That shouldn't be a problem as long as you keep the binary in your PYTHONPATH. As suggested before, if you have Python 2.5, you don't even need to install it yourself. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: problem opening html file with webbrowser.open

2007-10-29 Thread Stefan Behnel
for that: http://docs.python.org/lib/module-webbrowser.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing xml file in python

2007-10-30 Thread Stefan Behnel
X. The first is in the standard library of Python 2.5, the second is here: http://codespeak.net/lxml Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML DOM, but in chunks

2007-11-01 Thread Stefan Behnel
the record? >>> >>> Thanks, >>> Sean >>> >> You need a Python (or other language) implementation of the SAX API >> > The module you need is xml.sax That's unlikely - few people "need" SAX. If they think they do, they just don't know the alternatives. I think iterparse() is what he was looking for. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Stefan Behnel
than minidom. There's also lxml.objectify, in case you can't live without pickeling. http://effbot.org/zone/celementtree.htm http://codespeak.net/lxml Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML document causes pickle to go into infinite recursion

2007-11-01 Thread Stefan Behnel
a lot of other solutions. Stefan -- http://mail.python.org/mailman/listinfo/python-list

DOTALL not working as expected

2007-01-18 Thread Stefan Palme
atch the included "\n". When using the pattern "X(.|\n)*?Y" (explicity including "\n" in the set of "any character") I get the wanted result. My fault or a bug in the module? Thanks -stefan- -- http://mail.python.org/mailman/listinfo/python-list

Re: DOTALL not working as expected

2007-01-18 Thread Stefan Palme
Just noticed, that it works when *compiling* the pattern: import re p = re.compile('X.*?Y', re.DOTALL) print re.sub(p, 'Z', 'Xab\ncdY') Still the question - my fault or a bug? Best regards -stefan- On Thu, 18 Jan 2007 11:10:08 +0100, Stefan Palme wrote: &

Re: DOTALL not working as expected

2007-01-18 Thread Stefan Palme
arghh. Thanks for removing my blindness :) -stefan- On Thu, 18 Jan 2007 10:38:35 +, Roberto Bonvallet wrote: > Stefan Palme wrote: >>> using the "re" module of Python (2.3 and 2.4), I tried the following: >>> >>> import re >>>

[ANN] ftputil 2.2.1

2007-01-27 Thread Stefan Schwarzer
revised BSD license (see http://www.opensource.org/licenses/bsd-license.php ). Stefan -- Dr.-Ing. Stefan Schwarzer SSchwarzer.com - Softwareentwicklung für Technik und Wissenschaft http://sschwarzer.com http://ftputil.sschwarzer.net -- http://mail.python.org/mailman/listinfo/python-list

Re: sgmllib bug in Python 2.5, works in 2.4.

2007-02-04 Thread Stefan Rank
a bug-report. Thanks for doing that. The problem is the code that handles entity and character references in SGMLParser.parse_starttag. Seems that it is not careful about unicode/str issues. My quick'n'dirty workaround was to remove the offending char-entity from the website before feeding it to Beautifulsoup:: text = text.replace('®', '') # remove rights reserved sign entity cheers, stefan -- http://mail.python.org/mailman/listinfo/python-list

RE: [pywin32] - Excel COM problem

2007-02-14 Thread Stefan Schukat
400, 300) myShape.Select() xlsapp.Selection.Characters.Text = finalText[0:200] xlsapp.Selection.GetCharacters(200).Insert(finalText[200:400]) excelfile = "Hello.xls" wb.SaveAs(excelfile) wb.Close() xlsapp.Quit() Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EM

Re: Pep 3105: the end of print?

2007-02-16 Thread Stefan Rank
on 16.02.2007 13:02 Edward K Ream said the following: >> There are a tool called "2to3" that translates things like "print foo" to >> print(foo). > > The point of my original post was that if I want to maintain a common code > base the tool must translate 'print foo' to 'print2(foo)'. I think y

Re: xml.dom.minidom memory usage

2007-02-18 Thread Stefan Behnel
ofile and if you ever decide to need more features, there's lxml to the rescue. You might also consider streaming your XML piece by piece instead of creating in-memory trees. Python's generators are a good starting point here. Stefan -- http://mail.python.org/mailman/listinfo/python-list

timeout in urllib.open()

2007-02-19 Thread Stefan Palme
swers... Thanks and regards -stefan- -- http://mail.python.org/mailman/listinfo/python-list

Re: Django, one more newbie question

2007-02-19 Thread Stefan Scholl
Boris Ozegovic <[EMAIL PROTECTED]> wrote: > Umm, can somebody tell me which language is this one: >No polls are available. English? -- http://mail.python.org/mailman/listinfo/python-list

Re: timeout in urllib.open()

2007-02-19 Thread Stefan Palme
't there a "per-socket timeout" too? -stefan- > I believe this can only be set globally: > > import socket > socket.setdefaulttimeout(seconds) > > Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: timeout in urllib.open()

2007-02-19 Thread Stefan Palme
>>> [Peter] >>> I believe this can only be set globally: >>> >>> import socket >>> socket.setdefaulttimeout(seconds) >>> >> [Stefan] >> ... >> But when there is a "default timeout" (as indicated by >> the me

Re: HTML Parsing

2007-02-25 Thread Stefan Behnel
were talking about the best of both worlds already) use lxml's HTML parser, which is also capable of parsing pretty disgusting HTML-like tag soup. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: insert comments into elementtree

2007-11-16 Thread Stefan Behnel
odespeak.net/lxml/dev/ http://codespeak.net/lxml/dev/lxmlhtml.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: build a hierarchical tree, without using DOM,schema, and sax using expat parser and c

2007-11-16 Thread Stefan Behnel
r parsing, so there's no need to fiddle with it on your own - especially since it's pretty hard to get any faster than the C implementation of ET, cElementTree, is already... Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Excellent sci-fi novel featuring Python

2007-11-17 Thread Stefan Behnel
old already? I think it was just a conservative guess that Python 3000 would be out by then. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: getElementsByTagName in ElementTree

2007-11-19 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > what's the equivalent of minidom's getElementsByTagName in ElementTree? element.findall("//{namespace}tagname") Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I convert escaped HTML into a string?

2007-11-23 Thread Stefan Behnel
tent. There are quite a few ways to do that, including lxml.html: http://codespeak.net/lxml/dev/lxmlhtml.html >>> htmldata = """This &that ... or the other thing. >>> from lxml import html >>> print html.fragment_fromstring(htmldata).text_content() Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I convert escaped HTML into a string?

2007-11-24 Thread Stefan Behnel
e a built-in >> solution to what must be a very common problem. > > Replace "python" with "c++" and would that seem a reasonable belief? That's different, as Python comes with batteries included. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Rss Feed Creator

2007-11-27 Thread Stefan Behnel
gerclient/atom.py?rev=6717 The usage is mainly the same as in standard ElementTree. http://codespeak.net/lxml/dev/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: gnosis XML objectify

2007-11-27 Thread Stefan Behnel
y", > line 190, in ParseFile > self._myparser.ParseFile(file) > xml.parsers.expat.ExpatError: not well-formed (invalid token): line 68, > column 0 You XML input is broken. This is not a gnosis problem. Look at line 68 in your XML file. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: finding dir of main .py file

2007-12-11 Thread Stefan Reichör
hich are in a >>> subdirectory: >>> >>> myPythonApp.py >>> /resources >>> image1 >>> image2 >>> etc. >>> The following two versions are working for me: import os, sys print os.path.abspath(o

Re: Finding Line numbers of HTML file

2007-12-13 Thread Stefan Behnel
Ramdas wrote: > I am doing some HTML scrapping for a side project. > > I need a method using sgmllib or HTMLParser to parse an HTML file and > get line nos of all the tags Try lxml.html, it provides line numbers for each element. http://codespeak.net/lxml/dev/ Stefan -- http://mai

Re: XML partial validation.

2007-12-14 Thread Stefan Behnel
have more luck with those, especially since they are XML, so you can work on the schema documents and extract the sections that are relevant for a specific XML fragment. lxml is compatible with the ElementTree API, so you can reuse the ET code you already have. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate pdf file from an html page??

2007-12-19 Thread Stefan Behnel
abhishek wrote: > sh: a2ps: not found This should make you think. Sounds like a good reason to install a2ps... Stefan -- http://mail.python.org/mailman/listinfo/python-list

Preprocessing of input for the interactive interpreter?

2007-12-19 Thread Stefan Salewski
have this functionality, and I may use this one later.) It is possible to convert input in this form (input hook?): My custom input format: >>> b := 10a + 0,1 Format send to interpreter after preprocessing: >>> b = 10*a + 0.1 Best regards Stefan Salewski -- http://mail.python.org/mailman/listinfo/python-list

Re: state of XSLT2/XPath2 or XQuery in CPython

2007-12-26 Thread Stefan Behnel
SLT2 or XPath Features with CPython. All > the usual suspects 4suite or libxslt (via lxml) seem to have no support > yet. Is there any hope I oversaw something? I wouldn't know any implementation. Are you looking for a specific feature? Using Python functions in XPath/XSLT might get yo

RE: Help needed on COM issue

2006-04-19 Thread Stefan Schukat
Hi, the feature you expierenced are parameterized properties. This is only supported by VB and could only be emulated in python. If you use makepy/gencache to generate a wrapper the appropriate Set methods are created: oR.SetItem(1,2, "4") Stefan > -Original Messag

Re: Parsing XML/XSLT

2006-04-25 Thread Stefan Behnel
Beware though, I'm somewhat biased as I'm one of the authors. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to search HUGE XML with DOM?

2006-04-25 Thread Stefan Behnel
support for xml:id through the XMLDTDID function. It simply returns an XML tree and an ID dictionary. http://codespeak.net/lxml Stefan -- http://mail.python.org/mailman/listinfo/python-list

RE: Get all attributes of a com object

2006-04-28 Thread Stefan Schukat
classes. The properties you get with OBJ._prop_map_get_.keys(). Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of bruno at modulix > Sent: Friday, April 28, 2006 10:29 AM > To: python-list@python.org > Subject: Re:

RE: Get all attributes of a com object

2006-04-28 Thread Stefan Schukat
ll normally not provide a typelibrary but support dynamic dispatch. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting tuple to String

2006-04-30 Thread Stefan Lang
;Hello" and "There", despite "Hello" > and "There" being, in reality, seperate? Use the "join" method of strings: print ' '.join(xyz) -- Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Stefan Nobis
lowed up and screwed with workaround for language limitations (that are aimed at beginners and less capable programmers). Why only adjust to the less capable people? Give everyone what they need and want! :) -- Stefan. -- http://mail.python.org/mailman/listinfo/python-list

Re: the tostring and XML methods in ElementTree

2006-05-19 Thread Stefan Behnel
element.text = text > return s > > > Why isn't this the standard behaviour ? Because it wouldn't work. What if you wanted to serialize a different encoding than that of the strings you put into the .text fields? How is ET supposed to know what encoding your strings have? And how should it know that you didn't happily mix various different byte encodings in your strings? Use unicode, that works *and* is portable. Stefan -- http://mail.python.org/mailman/listinfo/python-list

RE: COM Server crashing when returning large arrays

2006-05-23 Thread Stefan Schukat
you could run out of memory since you have the Python objects and the COM data in your process. I think in 207 the patch was included. Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Alastair Alexander > Sent: Mon

Re: Remove namespace declaration from ElementTree in lxml

2007-12-28 Thread Stefan Behnel
his will not copy root-level PIs or internal DTD subsets. But you can copy PIs and comments by hand. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel processing in standard library

2007-12-28 Thread Stefan Behnel
already *is* part of stdlib: the threading module. So the processing module would fit just nicely into the idea of a "standard" library. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel processing in standard library

2007-12-28 Thread Stefan Behnel
Christian Heimes wrote: > Stefan Behnel wrote: > > Well, there is one parallel processing API that already *is* part of > stdlib: >> the threading module. So the processing module would fit just nicely into the >> idea of a "standard" library. > > Do

Re: Remove namespace declaration from ElementTree in lxml

2007-12-29 Thread Stefan Behnel
e tree, but it does create a new document, a new root element, and then moves the root children over from the original document, which also involves reference adaptations throughout the entire tree. So it does not come for free. I'd be interested if you can come up with numbers how it compares

Re: ElementTree should parse string and file in the same way

2007-12-31 Thread Stefan Behnel
e applies: I can't see the problem you are talking about. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree should parse string and file in the same way

2008-01-01 Thread Stefan Behnel
Peter Pei wrote: > To be preise [...] Preise the lord, not me. :) Happy New Year! Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML-XSD Processing/Creation.

2008-01-03 Thread Stefan Behnel
't currently a way to automatically bootstrap an implementation, especially not in XSD, so it depends on the language how much work it will be to get this to a usable state. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree should parse string and file in the same way

2008-01-03 Thread Stefan Behnel
ng is inherently an XML > *fragment*. Not inherently, no. I know some people who do web processing with an XML document coming in as a string (from an HTTP request) and a result XML document going out as a string. I don't think that's an uncommon use case. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree should parse string and file in the same way

2008-01-03 Thread Stefan Behnel
Fredrik Lundh wrote: > Stefan Behnel wrote: > >>> My take on the API decision in question was always that a file is >>> inherently an XML *document*, while a string is inherently an XML >>> *fragment*. >> >> Not inherently, no. I know some people

RE: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Stefan Schukat
No, py2exe does not display such information but has an algorithm to collect such information. Perhaps this is a starting point for you. Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bernhard Merkle Sent: Friday, January 04, 2008 2:25 PM To

RE: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Stefan Schukat
Hi, try to look at py2exe. This module scans all dependencies to pack them into one executable. Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bernhard Merkle Sent: Friday, January 04, 2008 1:14 PM To: python-list@python.org Subject

Re: Patches to Python 2.5.1

2008-01-07 Thread Stefan Behnel
so few, you could already have added the patch anyway. :) However, I'd just submit it to Python's bug tracker. Broken documentation is something that should be fixed. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's great, in a word

2008-01-07 Thread Stefan Behnel
Henry Chang wrote: > On Jan 7, 2008 5:41 AM, alain <[EMAIL PROTECTED]> wrote: >> Paraphrasing Steve Jobs but in this context: >> PYTHON = a bycycle for the mind > What exactly does it mean "a bycycle for the mind"?? Ask the Dutch guy near you. Stefan -- http:

Re: searching an XML doc

2008-01-16 Thread Stefan Behnel
lxml supports the same thing, BTW, and how to work with namespaces is explained in the tutorial: http://codespeak.net/lxml/dev/tutorial.html#namespaces Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Excess whitespace in my soup

2008-01-19 Thread Stefan Behnel
>> >>> re.sub("[ \n\r\t]+", " ", u"foo\n frab\xa0farn") >> u'foo frab\xa0farn' >> >> > > Yes, partially. Leading and trailing whitespace has to be removed > entirely, not replaced by one space. Sounds like adding a .strip() to me ... Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: isgenerator(...) - anywhere to be found?

2008-01-22 Thread Stefan Rank
#x27; return bool(func.func_code.co_flags & CO_GENERATOR) cheers, stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: isgenerator(...) - anywhere to be found?

2008-01-22 Thread Stefan Rank
on 22.01.2008 16:09 Paul McGuire said the following: > On Jan 22, 7:46 am, Stefan Rank <[EMAIL PROTECTED]> wrote: >> I also need to test for generator functions from time to time for which >> I use:: >> >>def _isaGeneratorFunction(func): >>'

Re: Problem with processing XML

2008-01-23 Thread Stefan Behnel
than what you already invested to learn 'the wrong thing'. It's what people on this list tend to call their "unlearning curve". Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Stefan Behnel
parser.setElementClassLookup(lookup) tree = etree.parse(filename, parser) for row in tree.iterfind("//Row"): print row.relationship, row.StartDate, row.Priority * 2.7 Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: docbook and xmlproc

2008-01-23 Thread Stefan Behnel
u to use lxml, which uses the parser and DTD validator of libxml2. http://codespeak.net/lxml/dev/ http://codespeak.net/lxml/dev/validation.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with processing XML

2008-01-23 Thread Stefan Behnel
quot;other XML technologies", it's only about making the standard XML technologies accessible and usable. It's about designing interfaces in a way that matches the tool people are using anyway, which in this case is Python. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a HTML parser who can reconstruct the original html EXACTLY?

2008-01-23 Thread Stefan Behnel
lained what your actual intention is? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Lxml on mac

2008-01-23 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > What to one do if one what to use lxml(http://codespeak.net/lxml/ > index.html) on a mac? Have you tried installing up-to-date versions of libxml2/libxslt and running easy_install lxml ? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Lxml on mac

2008-01-23 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > On Jan 23, 4:19 pm, Stefan Behnel wrote: >> [EMAIL PROTECTED] wrote: >>> What to one do if one what to use lxml(http://codespeak.net/lxml/ >>> index.html) on a mac? >> Have you tried installing up-to-date versions of libxml2/libxslt and r

Re: Processing XML that's embedded in HTML

2008-01-23 Thread Stefan Behnel
//Row"): > AttributeError: 'etree._ElementTree' object has no attribute > 'iterfind' > > > Is there some kind of newer version of lxml? Yep, lxml 2.0. It's currently in beta, but that doesn't say much. http://codespeak.net/lxml/dev/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Stefan Behnel
rst, without sorting the file? (or sort it afterwards if you still need to). That would heavily cut down your memory footprint. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Large File (Code/Performance)

2008-01-24 Thread Stefan Behnel
Stefan Behnel wrote: > [EMAIL PROTECTED] wrote: >>> What are you going to do with it after it's sorted? >> I need to isolate all lines that start with two characters (zz to be >> particular) > > "Isolate" as in "extract"? Remove the rest? &

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Stefan Behnel
Ever heard the word "PLONK"? Peter Pei harshly top-posted: > You didn't understand my question, but thanks any way. > > Yes, it is true that %s already support unicode, and I did not > contradict that. But it counts the number of bytes instead of > characters, and makes things like %-20s out of a

Re: Sorting Large File (Code/Performance)

2008-01-27 Thread Stefan Behnel
e sort command has no limit on file size. Sure, since no-one can ever try it with more than 640k, it's easy to state that there is no limit. :) Stefan -- http://mail.python.org/mailman/listinfo/python-list

<    6   7   8   9   10   11   12   13   14   15   >