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
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
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
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
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:
to speed
with real world software development.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
-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
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
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
[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
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
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
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
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
inux?
I think that's funny.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
-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
, 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
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
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
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
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
ml#refpower
Why exactly the decision was made I cannot say.
Stefan Krah
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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
http://cython.org/
Have fun,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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/
)
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
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
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
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
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
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
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
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
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
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
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
...
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
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
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
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
call last):
File "", line 1, in ?
TypeError: buffer object expected
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
[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
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
l.python.org/pipermail/python-list/2001-January/024980.html
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
> 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
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
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
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
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
te.com/ASPN/Python/Cookbook/
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
metic progressions.
"""
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
for that use case if
it's that easily solved with partial classes.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
ook/ :-) It wouldn't
make sense to duplicate all this stuff.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
patch;
hr = spIDispatch.CoCreateInstance(CLSID_ComServer);
CComDispatchDriver spSumDisp(spIDispatch);
CComVariant svarcResult;
CComVariant svarcParam1(5);
CComVariant svarcParam2(8);
spSumDisp.Invoke2(L"Add", &svarcParam1, &svarcParam1,
&svarc
COM object
pythoncom.CoUninitialize() // Release COM Runtime for this
thread
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
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,
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:
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
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
pythoncom.CoInitialize()
try:
matlab_object = Dispatch('matlab.application.single')
execute = getattr(matlab_object,'Execute')
execute(self.matlab_command)
finally:
matlab_object = None
pythoncom.CoUnitializ
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
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
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
>
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
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
601 - 700 of 2239 matches
Mail list logo