Re: Anyone still using Python 2.5?

2011-12-21 Thread Stefan Behnel
icial support until 2014. Similar considerations apply to many Solaris installations. The general consensus seems to be that support for Python 2.3 can easily be dropped, but that support for Py2.4 and later would be helpful. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone still using Python 2.5?

2011-12-21 Thread Stefan Behnel
ndor to upgrade to a new embedded Python version can be similarly long. That means it can take several years before an embedded 2.7 hits the end users, during which anything can happen, from "vendor switches from Python to Lua" to "vendor goes bankrupt" (or maybe just one a

Re: .format vs. %

2012-01-03 Thread Stefan Krah
cing the single line outfil.write("%s\n" % t) with outfil.write("{}\n".format(t)) adds 23% to the runtime. I think %-style formatting should not be deprecated at all. Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-03 Thread Stefan Krah
t;... >outfil_write(append_newline(t)) >... Did you profile this? I did, and it still adds 22% to the runtime. Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-03 Thread Stefan Krah
Neil Cerutti wrote: > On 2012-01-03, Stefan Krah wrote: > > $ ./python -m timeit -n 100 '"%s" % 7.928137192' > > 100 loops, best of 3: 0.0164 usec per loop > > % is faster, but not by an order of magnitude. > > On my machine: > > C:

Re: Getting involved

2012-01-07 Thread Stefan Behnel
to speed with real world software development. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting involved - Jython ElementTree performance

2012-01-07 Thread Stefan Behnel
Sophie Sperner, 07.01.2012 13:01: > On Jan 7, 11:53 am, Stefan Behnel wrote: >> A big issue that I have with Jython is that its ElementTree XML parser >> support is so increadibly slow. It could seriously benefit from a better >> integration between the Java XML support i

Re: how to install lxml in window xp?

2012-01-09 Thread Stefan Behnel
-builds http://lxml.de/installation.html#installation Note that lxml currently lacks binary Windows builds for its latest releases. There are eggs for the original 2.3 release, though. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: C-API: Pass a tuple to a method of a class

2012-01-10 Thread Stefan Behnel
em(args, 2, py_argument); > > cout << "Before the Exec:\n" ; > // Call our object method with arguments > //ret = PyEval_CallObject(method,args); > ret = PyObject_CallObject(method,args); Note that you are calling the method with three arguments here. It appea

Re: C-API: Pass a tuple to a method of a class

2012-01-10 Thread Stefan Behnel
Hi again, just as a little teaser, to make it clear that I'm not joking, here's your code below translated into Cython. Stefan Behnel, 10.01.2012 13:33: > [email protected], 10.01.2012 11:57: >> the code is the following: > [...] >> // Class >> pclass = PyOb

Re: C-API: Pass a tuple to a method of a class

2012-01-10 Thread Stefan Behnel
[cleaned up top-posted citation order to make the replies readable] 刘振海, 10.01.2012 14:24: > 2012/1/10 Stefan Behnel >> """ >> # in module "gluecode.pyx" (or whatever you want to name it) >> >> import mModule8 >> >> cdef ap

Re: open office in another language?

2012-01-11 Thread Stefan Behnel
many regard it as the future of OOo. It's certainly the place where the development happens these days. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: open office in another language?

2012-01-11 Thread Stefan Behnel
Paul Rudin, 11.01.2012 11:17: > Stefan Behnel writes: >> OOo has been fully scriptable in Python for ages. It even comes with an >> embedded Python runtime for that purpose [...] > > I have dabbled with PyUNO in the past. One issue is that the api seems > rather unp

Re: Is there a way to merge two XML files via Python?

2012-01-12 Thread Stefan Behnel
experienced in working with XML than I am. I recommend looking at the stdlib xml.etree.ElementTree module or the external lxml package (which contains the ElementTree compatible lxml.etree module). The latter will (likely) make things easier due to full XPath support and some other goodies, but E

Re: Zealotry [was Re: how to install lxml in window xp?]

2012-01-12 Thread Stefan Behnel
ftware from unknown third-party sources may simply not be a valid alternative in a given setting, e.g. on a company computer. As usual, it's not all that easy, but IMHO, recommending to use Linux isn't that much worse than recommending to install untrusted binary software. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Zealotry [was Re: how to install lxml in window xp?] (OT)

2012-01-13 Thread Stefan Behnel
inux? I think that's funny. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: open office in another language?

2012-01-13 Thread Stefan Behnel
btw.) is not implemented in Java, if that's > what you mean. > > It _is_ scriptable in Python, however there doesn't seem to be any > documentation available. Erm - care to take a look before making such a statement? http://www.openoffice.org/udk/python/python-bridge.html

Re: Hash stability

2012-01-15 Thread Stefan Behnel
uot; (suds uses hash() of > strings to create caches of objects/XML Schemas on the filesystem). That's a stupid design. Using a hash function that the application does not control to index into persistent storage just screams for getting the code broken at some point. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: defining class and subclass in C

2012-01-15 Thread Stefan Behnel
nctionality, instead of just learning about the bits and pieces of CPython's C-API, you may want to take a look at Cython. It makes writing efficient C extension modules fast and easy, especially when it comes to class hierarchies and similarly things. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Extension module question

2012-01-15 Thread Stefan Behnel
-init To implement the same interface for Unices and Windows, I suggest you write two separate extension modules and hide them in a Python package that does the appropriate platform specific imports at runtime. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Hash stability

2012-01-15 Thread Stefan Behnel
, that sounds a bit weak. Something like SHA256 should be substantially more robust. https://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_algorithms Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: C++ and Embedded Python

2012-01-20 Thread Stefan Behnel
r intention, please provide more details, including the steps you undertook so far and a specific description of what didn't work. You may also want to provide some hints on what kind of data you want to exchange and what both sides will do with it. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: etree/lxml/XSLT and dynamic stylesheet variables

2012-01-20 Thread Stefan Behnel
ps; these work in testing. But passing the > object to transform doesn't work. You should make the lookup explicit in your XSLT code using an XPath function. See here: http://lxml.de/extensions.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml to parse html

2012-01-23 Thread Stefan Behnel
d > nodes2=[] > why nodes1 is []?nodes2=[], Not on my side. I get two empty lists. > it is so strange thing?why ? The really strange thing that I don't understand is why you would use an HTML parser to parse an XML document. You should use lxml.etree instead. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: mySQLdb

2013-02-02 Thread Stefan Behnel
who's using it and gives you personalised results based on your previous interests. So if I tried, my responses would be different from what you saw. Maybe Armin Karner's search result even featured a link to github as the first result, I can't tell. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal 0**0

2013-02-05 Thread Stefan Krah
ml#refpower Why exactly the decision was made I cannot say. Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: real-time monitoring of propriety system: embedding python in C or embedding C in python?

2013-02-05 Thread Stefan Behnel
Python runtime is running the app, and is more commonly registered at the C level if you start Python from C. That being said, I'd encourage you to go for the "Python runs it all" approach first, because it tends to be less overhead and less fiddling to get it working. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python programming language?

2013-02-08 Thread Stefan Behnel
if you want. That doesn't render them any less Turing complete. In the same way, Python is a programming language that can be used for scripting, as well as lots of other things, from web programming to number crunching. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python trademark under attack -- the PSF needs your help

2013-02-15 Thread Stefan Behnel
that's very likely worth the bit of money they'd pay to their lawyer(s). Seriously - who's ever heard of them before this? So it worked already, didn't it? My advice: don't mention their name or their domain in any of your blog posts etc., and definitely don't link to them. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: request for help

2013-02-18 Thread Stefan Holdermans
uld lead to one. If I fix the indentation, as in import math def area(radius): return math.pi * radius**2 def circumference(radius): return 2 * math.pi * radius it works fine for me. HTH, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Nuitka now supports Python 3.2

2013-02-27 Thread Stefan Behnel
at *any* static analysis phase will just optimise away either completely or in major parts? It's not surprising that an empty loop runs faster than one that actually does something. And most real-world code avoids empty loops rather deliberately. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Speed

2013-02-28 Thread Stefan Behnel
o warm up any caches, so that you'd get better results. You can still get the results of all repeated runs if you pass -v. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Nuitka now supports Python 3.2

2013-02-28 Thread Stefan Behnel
Steven D'Aprano, 28.02.2013 14:23: > On Thu, 28 Feb 2013 08:07:55 +0100, Stefan Behnel wrote: > >> Steven D'Aprano, 26.02.2013 13:18: >>> Nuitka is an implementation of Python written in C++. At the moment it >>> is claimed to be about 2.5 time

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Stefan Behnel
variable to a specific type. Basically, you get Python semantics by default and C semantics if you want to. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Stefan Behnel
Stefan Behnel, 28.02.2013 22:03: > there are also a couple of projects that do > dynamic runtime compilation, most notably PyPy and Numba. Oh, and HotPy, I keep forgetting about that. > You may want to take a look at the Python implementations page, > specifically the list of Pyth

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-02-28 Thread Stefan Behnel
Steven D'Aprano, 01.03.2013 04:47: > On Thu, 28 Feb 2013 22:03:09 +0100, Stefan Behnel wrote: > >> The most widely used static Python compiler is Cython > > Cython is not a Python compiler. Cython code will not run in a vanilla > Python implementation. It has differen

Re: Interesting list() un-optimization

2013-03-07 Thread Stefan Behnel
e(10)) >> >>> i.__length_hint__() >> 10 >> >> See http://www.python.org/dev/peps/pep-0424/ > > Didn't know about that, thanks. Presumably a proper iter(QuerySet()) > object could implement __length_hint__ in an efficient manner rather > than by just calling the __len__ of the underlying QuerySet, And how exactly would it do that, without either doing what __len__ does or reading the whole result set into memory? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to couper contenier of a canvas in an outer canvas???

2013-03-15 Thread Stefan Behnel
answer it? This might help you in asking better questions next time: http://catb.org/~esr/faqs/smart-questions.html Note that there is also a list of translations, a couple of which might be easier to read for you: http://catb.org/~esr/faqs/smart-questions.html#translations Stefan -- http:

Re: OpenOpt Suite release 0.45

2013-03-15 Thread Stefan Behnel
ll just ignore release announcements that they do not immediately understand, assuming (correctly or incorrectly) that the software is not meant to be used by them. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Vowels [was Re: "monty" < "python"]

2013-03-24 Thread Stefan Behnel
Terry Reedy, 22.03.2013 00:05: > I never imagined that there were people who would mix up 'tuner' and > 'tuna'. Live and learn. I assume you know "The Chaos" ? http://ncf.idallen.com/english.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: JIT compilers for Python, what is the latest news?

2013-04-06 Thread Stefan Behnel
w complex the code is, though. I would guess that the main problem is rather that PyPy doesn't support NumPy (it has its own array implementation, but that's about it). John already mentioned that most of the heavy lifting in his code is done by NumPy. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: psutil 0.7.0 released

2013-04-12 Thread Stefan Behnel
es of software packages: http://mail.python.org/mailman/listinfo/python-announce-list (And no, it's not that the unimportant ones should go here...) Stefan -- http://mail.python.org/mailman/listinfo/python-list

API design for Python 2 / 3 compatibility

2013-04-13 Thread Stefan Schwarzer
that approach? Are there other approaches I have overlooked? Do you have other suggestions? Best regards, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: API design for Python 2 / 3 compatibility

2013-04-14 Thread Stefan Schwarzer
e names that will be visible to client code. So this is also a good opportunity to clean up the file interface. :) Best regards, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Grammar question: Englisn and Python: qualified names

2013-04-14 Thread Stefan Schwarzer
read it somewhere, it wouldn't cross my mind that the writer used "an collections.OrderedDict" with the idea not to pronounce "collections". ;-) In my opinion, this is too subtle. On the other hand, when you _speak_ about the ordered dict, use the article matching what you actually say. Best regards, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: The node.js Community is Quietly Changing the Face of Open Source

2013-04-17 Thread Stefan Behnel
Boilerplate > # generator-backbone Yeoman generator for Backbone.js > > > https://npmjs.org/~sindresorhus > > I wonder, how much copy-and-pasting between packages does he do? It's possible that the answer is "none", and that you actually need to install all of h

New release 0.19 of the Cython compiler

2013-04-19 Thread Stefan Behnel
http://cython.org/ Have fun, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding new source types to distutils?

2013-04-28 Thread Stefan Behnel
essors and also avoids conflicts between packages like the one you describe above, or problems with future versions of distutils due to fragile build setups. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.etree.ElementTree if element does not exist?

2013-04-29 Thread Stefan Holdermans
e does not contain a child element "orange"' else: print myElement.text $ python test.py tree does not contain a child element "orange" HTH, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding referents with Gdb

2013-05-01 Thread Stefan Behnel
Dave Butler, 23.04.2013 16:52: > with gdb, can you find referents of an object given an object id? Have you looked at the gc module? And, could you explain why you want to work with the object's ID instead of the object reference itself? Stefan -- http://mail.python.org/mailman/

Re: "0 in [True,False]" returns True

2005-12-13 Thread Stefan Rank
) and as it is the only thing in operator that is not really reflecting an operator, I had a look into PEP3000 to see if (the redundant) operator.truth is going to be removed. It is not mentioned. (not that I really care, but I thought I could provide something productively new to discuss

Queueing in Python (ala JMS)

2005-12-20 Thread Stefan Arentz
Is there a JMS-like API available for Python? I would like to quickly receive messages through the network and then process those slowly in the backgound. In the Java world I would simply create a (persistent) queue and tell the JSM provider to run N messagehandlers parallel. Is something like th

Re: New Python.org website ?

2006-01-11 Thread Stefan Rank
on 11.01.2006 11:44 Steve Holden said the following: > > http://beta.python.org > Very nice! Just wanted to note that the content area and the menu area overlap (leaving some content unreadable) in Opera 8.51 / WinXP str -- http://mail.python.org/mailman/listinfo/python-list

Python script running as Windows service: Clean shutdown

2006-01-11 Thread Stefan Krah
e) >> 8 if retval == 0: eclient.submit_chunk(sys.argv[1], int(sys.argv[2])) eclient.get_chunk(sys.argv[1], int(sys.argv[2])) elif retval == 1: eclient.get_chunk(sys.argv[1], int(sys.argv[2])) time.sleep(10) else: """./enigma has caught a signal

Template language with XPath support for source code generation?

2006-01-12 Thread Stefan Behnel
rehand, no problem, but I then need to access the result from the template - and that's almost impossible without XPath. Does anyone have an idea what I could use? Any hints are helpful. Thanks, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Template language with XPath support for source code generation?

2006-01-13 Thread Stefan Behnel
bruno at modulix wrote: > Stefan Behnel wrote: >> I need to generate source code (mainly Java) from a domain specific XML >> language, preferably from within a Python environment (since that's where the >> XML is generated). >> >> I tried using XSLT, but I fo

Re: How to display name of elements in list?

2006-07-12 Thread Stefan Behnel
ow to access these values. Any idea? The list above is not a valid Python list. What is it that you store in that list? Or is it maybe a dictionary? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to display name of elements in list?

2006-07-12 Thread Stefan Behnel
cz schrieb: >> The list above is not a valid Python list. What is it that you store in that >> list? >> >> Or is it maybe a dictionary? >> >> Stefan > > Thanks for your help. How can I find out about what this is? As I said > it's generated by a

Re: PDF with nonLatin-1 characters

2006-07-12 Thread Stefan Behnel
at would you suggest? I'd suggest generating LaTeX code and using PDFlatex. It's pretty hard to get better results from any other tool. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: testing array of logicals

2006-07-12 Thread Stefan Behnel
alse( logflags ).next() except StopIteration: test = True otherwise: your above code will do just fine. Note that you can shortcut, though, if any of the flags evaluates to False: test = True for x in logflags: if not x: test = False break Stefan -- http://ma

Re: Problem with "&" charater in xml.

2006-07-12 Thread Stefan Behnel
Kirt wrote: > i have walked a directory and have written the foll xml document. > one of the folder had "&" character so i replaced it by "&" > #--test1.xml > > C:\Documents and Settings\Administrator\Desktop\1\bye > w&y > > def.txt > 200607130417 > > > > C:\Docum

Re: Problem with "&" charater in xml.

2006-07-13 Thread Stefan Behnel
... http://effbot.org/zone/element-iterparse.htm http://codespeak.net/svn/lxml/trunk/doc/api.txt Stefan > Stefan Behnel wrote: >> Kirt wrote: >>> i have walked a directory and have written the foll xml document. >>> one of the folder had "&" character so i

Re: help in xml and python

2006-07-13 Thread Stefan Behnel
elieve there's nothing below 80€, then they're more likely to ask for the people who know their real value. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: bay area based - python guru..

2006-07-13 Thread Stefan Behnel
g an inordinate amount of > time to resolve, so we thought we'd toss this here and see if anyone has > thoughts/comments. What about reading the answers you got when you asked the same question eleven days ago? Maybe the right thing to ask back is: how much do you pay? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: bay area based - python guru..

2006-07-13 Thread Stefan Behnel
Simon Brunning wrote: > On 7/13/06, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Maybe the right thing to ask back is: how much do you pay? > > And possibly; *which* bay? ;-) What do you mean? Is there more than one Bayern? http://en.wikipedia.org/wiki/Bayern Stefan -- h

Re: How to convert arbitrary objects directly to base64 without initial string conversion?

2006-07-13 Thread Stefan Behnel
call last): File "", line 1, in ? TypeError: buffer object expected Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: RedHat: Easiest way to upgrade from Python 2.3 to 2.4

2006-07-13 Thread Stefan Behnel
ge will normally be called "python2.4", so if your current installation uses plain "python" (rpm -q python), you can install it without any problems with backwards compatibility. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cool Ebooks Site

2006-07-13 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > Submit your comments because I need them! [loads of SPAM deleted] As I infer from the type of your posting, what you *want* is a good placement in Google, but what you really *need* is a good lawyer. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Line by line execution of python code

2006-07-13 Thread Stefan Behnel
nction, and then also > resume the user program the next time around, without the call stack just > spiraling out of control. I assume that tracing would be a good solution, though. Maybe someone else can tell you how to use it better than I could. You should tell us a bit more about the actual use case, i.e. *why* you need this. Maybe there's a better solution to the whole problem after all. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: TFTP client in python

2006-07-13 Thread Stefan Behnel
l.python.org/pipermail/python-list/2001-January/024980.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: TFTP client in python

2006-07-14 Thread Stefan Behnel
> Stefan Behnel [EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >>> Is there a TFTP client python module? I just need "get file" feature. >>> I came across two implementations on WEB, but they are kind of >>> unfinished (got the code from some

Re: OT: Search for python in Norway

2006-07-14 Thread Stefan Behnel
rage in India :) > http://www.google.com/trends?q=java&ctab=1&geo=all&date=all So what? That just means those countries are still looking for them, while those not in the list no longer bother asking Google. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: insert method in ElementTree

2006-07-16 Thread Stefan Behnel
t.getparent()) and add the child there or * use the iterwalk() function to add the child when backtracking up the tree or * implement the whole thing in XSLT (with a custom evaluator function in Python). There may also be other ways to do it. Just give it a try: http://codespeak.net/lxml/ http://c

Re: Very simple speed benchmark of few string substitions ways

2006-07-16 Thread Stefan Behnel
swiss knife is slower in handling as it requires additional opening. So I decided to stop using it. I just don't get why they keep producing these things. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: embedding executable code in a regular expression in Python

2006-07-16 Thread Stefan Behnel
were referring to security concerns: Sufficiently complex REs can take ages to compile and run and eat tons of memory, so there are always issues involved here. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: General Hash Functions In Python

2006-07-17 Thread Stefan Behnel
te.com/ASPN/Python/Cookbook/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with "&" charater in xml.

2006-07-17 Thread Stefan Behnel
tor\Desktop\1\hii wx > > where as i need an output which should look like this. > C:\Documents and Settings\Administrator\Desktop\1\bye w&y > > C:\Documents and Settings\Administrator\Desktop\1\hii wx This SAX filter is another way of doing it: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/265881 Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode html

2006-07-17 Thread Stefan Behnel
numeric entities for everything that's not ASCII. >>> from lxml import etree >>> root = etree.HTML(my_html_data) >>> html_7_bit = etree.tostring(root, "us-ascii") Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: range() is not the best way to check range?

2006-07-18 Thread Stefan Behnel
metic progressions. """ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: New SourceForge project: Diet Python!!!

2006-07-19 Thread Stefan Behnel
3.html> Great Scott! I don't think this newsgroup can handle another 100 million newbies! Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: need help getting xml feed from a url

2006-07-19 Thread Stefan Behnel
Shan wrote: > If i have a list of urls how can I extract or pull their respective xml > feeds? from lxml import etree feeds = [] for url in my_url_list: feeds.append( etree.parse(url) ) For the rest, find out about the ElementTree API. Stefan -- http://mail.pyth

Re: Partial classes

2006-07-19 Thread Stefan Behnel
for that use case if it's that easily solved with partial classes. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Depricated String Functions in Python

2006-07-19 Thread Stefan Behnel
er(). Both of them would return an output : >>> python I don't quite see the question in your post, but, yes, the module level functions of the "string" module are deprecated in favour of the methods of the str and unicode objects. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Functions, Operators, and Overloading?

2006-07-24 Thread Stefan Behnel
on the number of arguments supplied? > > I guess you can do that with a list as only argument. But can that be done > using the "normal" function argument notation? I guess you mean something like func1(int1, arg2, *args): if len(args) == 2: ... el

Re: XML parsing and writing

2006-07-31 Thread Stefan Behnel
it with ElementTree or lxml, that usually helps you in getting your work done. http://effbot.org/zone/element-index.htm http://codespeak.net/lxml/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get size of unicode string/string in bytes ?

2006-08-01 Thread Stefan Behnel
not need to deal with this kind of detail. Since you say "read back later", maybe what you actually want is a serialisation of the unicode string in, say, UTF-8 or something, that you can actually write to a file and read back. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get size of unicode string/string in bytes ?

2006-08-01 Thread Stefan Behnel
Diez B. Roggisch wrote > Stefan Behnel wrote: > >> [EMAIL PROTECTED] wrote: >>> how can I get the number of byte of the string in python? >>> with "len(string)", it doesn't work to get the size of the string in >>> bytes if I have the unico

Re: programming is hard

2006-08-03 Thread Stefan Schwarzer
ook/ :-) It wouldn't make sense to duplicate all this stuff. Stefan -- http://mail.python.org/mailman/listinfo/python-list

RE: how to use python com server in c++?

2006-08-21 Thread Stefan Schukat
patch; hr = spIDispatch.CoCreateInstance(CLSID_ComServer); CComDispatchDriver spSumDisp(spIDispatch); CComVariant svarcResult; CComVariant svarcParam1(5); CComVariant svarcParam2(8); spSumDisp.Invoke2(L"Add", &svarcParam1, &svarcParam1, &svarc

RE: Thread termination

2006-10-13 Thread Stefan Schukat
COM object pythoncom.CoUninitialize() // Release COM Runtime for this thread Stefan -- http://mail.python.org/mailman/listinfo/python-list

RE: Thread termination

2006-10-17 Thread Stefan Schukat
Hello   you are using the module variable ie inside the Generic Function, but you have to use  "d" since this is the Python object which is allowed to access the COM object in the separate thread.       Stefan From: Tejovathi P [mailto:[EMAIL PROTECTED] Sent: Monday,

RE: python thread state

2006-10-24 Thread Stefan Schukat
For this use case the PyGILState API was introduced. e.g. try PyGILState_STATE state = PyGILState_Ensure() run python code PyGILState_Release(state) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Bryan > Sent:

Re: FTP over SSL

2006-10-24 Thread Stefan Schwarzer
arzer.net [3] http://ftputil.sschwarzer.net/trac/browser/branches/add_stat_caching/ftputil.txt?rev=622 line 893 Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression help for parsing html tables

2006-10-28 Thread Stefan Behnel
t use a real HTML parser and API (e.g. the one provided by lxml)? That can really make things easier here. http://codespeak.net/lxml/ http://codespeak.net/lxml/api.html#parsers http://codespeak.net/lxml/api.html#trees-and-documents http://effbot.org/zone/element-index.htm Stefan -- http://mail.p

RE: Python opening multiple thread of matlab

2006-11-11 Thread Stefan Schukat
pythoncom.CoInitialize() try: matlab_object = Dispatch('matlab.application.single') execute = getattr(matlab_object,'Execute') execute(self.matlab_command) finally: matlab_object = None pythoncom.CoUnitializ

jython's future (was: Python development time is faster.)

2006-11-13 Thread Stefan Behnel
to say: "hey, this feature is lacking to make my program run" than: "let's see, what else is there in that outdated specification to implement?". And it's a lot more encouraging, too. Just my little rant on this one ... Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Parsing and Indexing

2006-11-13 Thread Stefan Behnel
development). Currently > this project is under heavy development. > > I need a help on HTML parser. lxml includes an HTML parser which can parse straight from URLs. http://codespeak.net/lxml/ http://cheeseshop.python.org/pypi/lxml Stefan -- http://mail.python.org/mailman/listinfo/python-list

RE: PyWin32-winxptheme and py2exe

2006-11-15 Thread Stefan Schukat
You probably need to include the common Control Manifest to supprt themes see in the py2exe\samples\advanced directory for an example how to do it. Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Andrea Gavana >

Re: lxml/ElementTree and .tail

2006-11-15 Thread Stefan Behnel
o this apparent divergence > between the ET DOM API and "standard" DOM APIs was roughly: "that's just > the way it is". It's just a matter of understanding (or getting used to) the API. You might want to stop thinking in terms of '<' and '>' and rather embrace the API itself as a way to work with the XML Infoset (rather than the XML DOM). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml/ElementTree and .tail

2006-11-16 Thread Stefan Behnel
Fredrik Lundh wrote: > Stefan Behnel wrote: > >> If you want to copy part of of removed element back into the tree, >> feel free to do so. > > and that can of course be done with a short helper function. Oh, and obviously with a custom Element class in lxml that does th

<    2   3   4   5   6   7   8   9   10   11   >