l's? (it even does not work if i have the pyd files in the
(same) folder than the system where I start my embedded python program.
It would be great if someone would have an idea, at least how to get me
started on this.
thanks a lot in advance,
-stefan
--
http://mail.python.org/mailman/listinfo/python-list
thanks a lot for the quick answer.
I had to provide the debug-versions, since I was in debug mode, like
you already expected! thanks a lot again!
-stefan
--
http://mail.python.org/mailman/listinfo/python-list
())
I can only get a list with the arguments or the defaults. The following
examples would return the same:
def foo(x, y=True)
def foo(x=True, y)
Anyone an idea?
Thanks,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
es for syntax
errors.
Thanks a lot,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
the GIL when you don't need it, and the compiler will produce errors when
you try to do things that require the GIL while you don't own it.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
in this case.
If you need better compatibility, consider writing your code in Cython.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
os on this thread, maybe
a package on pypi first grounding somewhat the presumably massive
discussion thread on python-ideas :-?)
All the best,
Stefan.
--
http://mail.python.org/mailman/listinfo/python-list
s iterating over results as they come in. It also comes
with a parallel map() implementation.
http://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example
http://docs.python.org/3/library/concurrent.futures.html#module-functions
New in Py3.2, but there's also a backport AFAIR.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
log out of your
Google accounts, and then retry. Maybe disabling JavaScript helps. Or
enabling the Privacy Mode in your browser. Or try a different browser all
together. Or a different search engine. Google has lots of ways to detect
who's asking.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
x27;m sure Armin and Alex can
use some help and testing by others to get a new release out. There's
always stuff like reading through and updating the documentation, finding
bugs, testing with your existing code base, etc., that everyone can help with.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
statement. ISTM that most projects
that use Lua build their own eco-system around it, or integrate Lua into
their existing eco-system, with the obvious drawbacks for code reuse across
different projects and user bases.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Fábio Santos, 11.07.2013 10:16:
> Guido tweeted that yesterday. It seems interesting. Although I'm not
> comfortable using a subset of the language.
>
> They seem to want to kill the GIL. This could get much more popular when
> they do.
Then don't forget to also take
t;
> I tend to agree with you. I'm not sure how go monolithic with Python.
PyRun? py2exe? Just to name two.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Well, since you mentioned it already, have you actually looked at pygame?
It should be able to do what you want. There's also pyaudio, which is more
specialised to, well, audio. A web search for python and ogg might provide
more.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
an unbalanced way that it visibly changes its execution
profile. Always make sure you validate your code changes with benchmarks,
outside of the profiler.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Devyn Collier Johnson, 20.07.2013 14:25:
> On 07/20/2013 12:21 AM, Stefan Behnel wrote:
>> Devyn Collier Johnson, 20.07.2013 03:06:
>>> I am making a chatbot that I host on Launchpad.net/neobot. I am currently
>>> converting the engine from BASH code to Python3.
d
for the simple case, you'd have to type more, either the additional .keys()
or the useless tuple unpacking. So, the reasoning is that iteration should
do the basic thing that still allows you to do everything, instead of doing
everything and pushing unnecessary work on the users by default.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
problem.
They reduce the API overhead. Previously, you needed values() and
itervalues(), with values() being not more than a special case of what
itervalues() provides anyway. Now it's just one method that gives you
everything. It simply has corrected the tradeoff from two special purpose
API
hinking that maybe it is a human being. It had me fooled for a long
>>> time.
>
> Does this mean he passes the Turing test?
I'd say that "it" appears more correct. Or is there any indication of a
specific bot gender? (I sure might have missed it...)
Note that
Ethan Furman, 24.07.2013 20:31:
> On 07/24/2013 10:23 AM, Stefan Behnel wrote:
>> Peter Otten, 24.07.2013 08:23:
>>> Ethan Furman wrote:
>>>>
>>>> So, my question boils down to: in Python 3 how is dict.keys() different
>>>> from dict? What ar
9: File "", line 55, in main
> 9: AttributeError: 'builtin_function_or_method' object has no attribute
> 'sleep'
>
> suddenly the sleep module has been unloaded?? huh? i thought the thread
> state had been preserved?
You didn't sh
e same globals dict for both scripts, I guess?
That explains it then.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
doesn't have
this accelerator function.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
slower for mostly unique data.
Maybe a "fast_dict_lookup" option for the accelerator that forces the fast
path would fix this. The Counter class, just like many (most?) other
subtypes of dict, definitely doesn't need the fallback behaviour.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Stefan Behnel, 30.07.2013 08:39:
> Serhiy Storchaka, 29.07.2013 21:37:
>> 29.07.13 20:19, Ian Kelly написав(ла):
>>> On Mon, Jul 29, 2013 at 5:49 AM, Joshua Landau wrote:
>>>> Also, couldn't Counter just extend from defaultdict?
>>>
>>> It cou
My advice: write a good test suite for your code and use something like tox
to run it under the various Python versions that you want to support. No
static analysis tool will ever be able to find all portability problems.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
us degrees of interpretation and compilation, such as JIT compilation
of otherwise interpreted code.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
or python C api.
>
> What should i do? Which file's code should i read to understand those
> PyObject or other type and other C apis?
The first thing to ask yourself is: why do you want to understand it? What
is the thing you are trying to do with it? Once you've answered that, i
for everything than to look up and
sometimes even learn one method for each kind of object you are dealing
with? Python prefers simplicity here. You want the length? Use len().
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
r something?
Yes. Please read the CPython developer guide (click on "core development"
on the Python front page).
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
from the source repository.
However, if you want to contribute to the project, it's still worth
considering to work with Mercurial.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ve-vuln-in-ruby/
Stefan Krah
--
http://mail.python.org/mailman/listinfo/python-list
he performance.
http://docs.cython.org/src/tutorial/numpy.html
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
t.
And, no, there won't be a Py4 in 5 years. The established release time
frame is way longer.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ocal screen but also directly to the
PSF so that they can fund developers who are able to delete that error
message from the interpreter based on real world statistical evidence. That
would eventually make the language match the powerset of what all users
have in their fingers. A very worthy goal, if you ask me.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
you can even
pass it into some code as callback, although I rarely had a need for that.
Stefan
[1] Seriously, it's not very helpful in interactive mode and too simplistic
to be used in application code. Even scripts often work better with logging
than with prints.
--
http://mail.python.org/mailman/listinfo/python-list
chunks, I
> removed that to test a theory. It creates buffer_new with the output
> of the read.
>
> Running type() on buffer_new tells me that it's a bytes object.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ing in
Py2.[67] (which supports the opposite "b" prefix). We've been supporting
that in Cython for a while and it worked out really well so far.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
;imperfect" way, either by doing the right thing already or
by printing out a tuple instead of a space separated string. If it's only
for debug output (which, as I said, would better be served by the logging
module), I can't see why that would be all that unacceptable.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
and start warning about it in the next one. You're then free to use
the corresponding 2to3 fixer to get it back out of your code with a single
patch.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ce cleared and all that,
but nevertheless non-MS. When they dropped the IronPython project, it
became free to integrate with other software.
Clearly a cultural thing.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
> help much right?
Dicts are fast for lookup, not for searching.
> Anyway, does python have a built-in BST like data-structure ?
It has lists and bisect:
http://docs.python.org/library/bisect.html
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
e
> five.contents[five.contents[:].index(5)] = 4
> print(2 + 2 == 5) # True (must be sufficiently large values of 2 there...)
>
> Heh. The author is apparently anonymous, I guess for good reason.
That's not portable, though. ;)
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
shoes for
each job interview sounds reasonable once you have a salary well beyond
your own capabilities.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
rop the
lowest layer entirely. In fact, my advice is to really skip that lowest
layer in a Cython wrapper, because if it's really just a 1:1 mapping, it's
going to end up with a lot of boring and redundant code and you won't gain
anything from it.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ting to True by default
(object), unless they implement the test themselves.
As Chris said, very convenient.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
gaodexiaozh...@gmail.com, 17.07.2012 10:35:
> hi,do you know the PyXML whether can be supported by Jython ?
PyXML is a dead project, don't use it.
You can use ElementTree in Jython, just as in Python.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Matej Cepl, 17.07.2012 11:39:
> On 17/07/12 10:35, gaodexiaozh...@gmail.com wrote:
>>> > I'm trying to parse an xml file with jython (not through java
>>> parsers
>>> > like xerces).
>
> https://code.google.com/p/jython-elementtree/ ???
Note tha
rily -- then I'd
> obviously avoid relying on it.
You should.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
that it's a common property. Iteration
over data structures should tend to be deterministic, after all.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
. But then, suddenly, there is a bad
> character in a new file. (This is so because most files today are
> generated by people who don't know that there is such a thing as
> encodings.) And then I need to rewrite my very complex program just
> because of one single character in one single file.
Why would that be the case? The places to change should be very local in
your code.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
open and parse different
> types of files. When I read and parse a directory with such different
> types of files, a program that
> uses
>
> for line in f:
>
> will not exit with any hint as to where the error occurred. I just
> exits with a UnicodeDecodeError.
... that tells you the exact code line where the error occurred. No need to
look around.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Philipp Hagemeister, 26.07.2012 14:17:
> On 07/26/2012 01:15 PM, Stefan Behnel wrote:
>>> exits with a UnicodeDecodeError.
>> ... that tells you the exact code line where the error occurred.
>
> Which property of a UnicodeDecodeError does include that information?
>
> fact it was remarkably easy to do this in python
Just a comment on this part. An even easier way to count source lines is by
using the tool "SLOCCount". It also works with various languages.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
mentation).
I find it perfectly reasonable to use C code (and other kinds of low-level
code) in Python tools and applications. In fact, easy interfacing with
low-level code is one of (C)Python's major selling points.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
r backends, usually written in
languages I don't have to care about because they provide a language
independent interface.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
s to
> leverage off of PyPy's toolchain, for example?
>From a look at the source code, it seems hard to bring it together with
anything. It looks very monolithic.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin, 31.07.2012 06:45:
> A real compiler (PyPy) will help Python performance far more than
> multi-core currently can.
That's too general a statement to be meaningful.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
eck if the deep copy is really necessary, and if so, if
it is really necessary to do it over the full depth of the entire object graph.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Stefan Behnel, 31.07.2012 07:23:
> From a look at the source code, it seems hard to bring it together with
> anything. It looks very monolithic.
Hmm, sorry, I mixed it up with "2c.py", which is yet another of those
Python-to-C compilers with an all too similar name.
https://code
NoneType' object has no
> attribute 'clone'
>
> Well, I think I'm starting to feel less and less enthusiastic about python...
> I didn't suspect it would be so difficult to write a basic doc file :)
"pip" goes with "distribute", not "setuptools".
http://packages.python.org/distribute/
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
#x27;re ready to
>>> drink it from the glass. Don't you know anything about the importance of
>>> process and timing? :)
>>
>> Heh heh, obviously never got drunk ... er I mean served behind the bar
>> at uni/college/pub %-}
>
> Nah, obviously *is*
rahul, 02.08.2012 11:50:
> When I use same code base for Python 3.x, then behavior is different.
You might want to take a look at Cython. It moves most of these "funny"
little details off your shoulders.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
s/disclosures/email.
Huh? Who's still trying to sell viruses these days? I thought they came for
free?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
iler that is
widely used. Compiles and optimises Python to C code that uses the CPython
runtime and allows for easy manual optimisations to get C-like performance
out of it.
http://cython.org/
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano, 04.08.2012 09:49:
> On Sat, 04 Aug 2012 08:40:16 +0200, Stefan Behnel wrote:
>> And not to forget Cython, which is the only static Python compiler that
>> is widely used. Compiles and optimises Python to C code that uses the
>> CPython runtime
Mark Lawrence, 04.08.2012 12:05:
> I agree so it's off topic and can't be discussed here. Isn't that right,
> Stefan?
Hmm, in case you are referring to a recent friendly and diplomatic request
of mine regarding a couple of people who were burdening a public high
volume maili
zero-fault software world: Several verification
tools do exist and Leroy et al. are writing a certified compiler for
C to plug the hole between the verified source code and the generated
assembly.
Stefan Krah
--
http://mail.python.org/mailman/listinfo/python-list
ation is written in C and
makes it easy to interface with C code.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Rachel, 04.08.2012 14:51:
> Am 04.08.2012 11:10 schrieb Stefan Behnel:
>> As long as you don't use any features of the Cython language, it's plain
>> Python. That makes it a Python compiler in my eyes.
>
> Tell that the C++ guys. C++ is mainly a superset of
Stefan Behnel, 04.08.2012 15:53:
> Thomas Rachel, 04.08.2012 14:51:
>> Am 04.08.2012 11:10 schrieb Stefan Behnel:
>>> As long as you don't use any features of the Cython language, it's plain
>>> Python. That makes it a Python compiler in my eyes.
>>
Paul Rubin, 04.08.2012 17:59:
> Stefan Krah writes:
>> In the free software world, apparently many people like C. C is also
>> quite popular in the zero-fault software world: Several verification
>> tools do exist and Leroy et al. are writing a certified compiler for
>>
Paul Rubin, 04.08.2012 20:18:
> Stefan Behnel writes:
>>> C is pretty poor as a compiler target: how would you translate Python
>>> generators into C, for example?
>> Depends. If you have CPython available, that'd be a straight forward
>> extension type.
Paul Rubin, 04.08.2012 22:43:
> Stefan Behnel writes:
>>> Calling CPython hardly counts as compiling Python into C.
>> CPython is written in C, though. So anything that CPython does can be
>> done in C. It's not like the CPython project used a completely unu
ge) can be
called directly from other code implemented in C. That's very common in the
CPython ecosystem.
There are a lot of simple things that quickly add up into a much better
performance on average.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Jürgen A. Erhard, 05.08.2012 01:25:
> On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote:
>> Steven D'Aprano, 04.08.2012 08:15:
>>> Most people are aware, if only vaguely, of the big Four Python
>>> implementations:
>>
>> And not to fo
Stefan Behnel, 05.08.2012 07:46:
> Jürgen A. Erhard, 05.08.2012 01:25:
>> None of the other implementations require Python for actually
>> compiling or running Python source.
>
> Nuitka was on the list as well.
Oh, and Stackless was also on Steven's list, as well as W
There's also HotPy:
>
> http://code.google.com/p/hotpy/
> http://www.hotpy.org/
And just in case anyone was wondering where the others are:
http://wiki.python.org/moin/PythonImplementations
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Jürgen A. Erhard, 05.08.2012 14:28:
> On Sun, Aug 05, 2012 at 07:46:59AM +0200, Stefan Behnel wrote:
>> Jürgen A. Erhard, 05.08.2012 01:25:
>>> None of the other implementations require Python for actually
>>> compiling or running Python source.
>>
>> Nu
t maintained somewhere?
Hijacking this page would be a good place to start it IMHO:
http://wiki.python.org/moin/Embedding%20and%20Extending
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
e a look at Cython. It makes these things way easier and
safer than with manually written C code. It will save you a lot of code,
debugging and general hassle.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
on't have to read them. :)
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Giacomo Alzetta, 11.08.2012 10:55:
> Il giorno sabato 11 agosto 2012 08:40:18 UTC+2, Stefan Behnel ha scritto:
>> Giacomo Alzetta, 11.08.2012 08:21:
>>
>>> I'd prefer to stick to Python and C, without having to put cython
>>> sources or cython-genera
led **
>
> Using build configuration of libxslt
> error: Setup script exited with error: Unable to find vcvarsall.bat
>
> C:\Users\ian>
>
> Now what? I thought I was installing the binary package do I would not need
> any development versions.
>
> What do these
e time machine strikes again.
Python 3.3.0b1 (default:f7b59e890e30, Aug 11 2012, 05:30:10)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> type(None)()
>>> print(type(None)())
None
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Ramchandra Apte, 16.08.2012 17:39:
> On 16 August 2012 21:01, Stefan Behnel wrote:
>> Steven D'Aprano, 16.08.2012 15:58:
>>>>> NoneType raises an error if you try to create a second instance.
>>> In my opinion, this is a PITA for None and better behaviour w
o old and doesn't support parsing
real-world HTML. IIRC, that started with 2.6.21 and got improved a bit
after that.
Get a 2.8.0 installation, as someone pointed out already.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
must ignore the order in
which elements occur. But that won't magically make the parser ignore it
for you. That's a totally different level of abstraction and a deliberate
decision of the code that *uses* the parser.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ostly usable
in Cython 0.17.
All of this makes Cython the ideal language for wrapping external C
libraries, embedding CPython into existing applications, and for fast C
modules that speed up the execution of Python code.
Have fun,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ou think you can do better here then IronPython or
PyPy, please go ahead.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
sed to run on (macs with OS X Lion) and it seems to
> be dormant.
>
> My requirements are stock OS X Python (which is 2.7) and Lua 5.2. I'm
> looking for either a way to make lunatic-python work or another tool
> that would do the job.
Try Lupa:
http://pypi.python.org/pypi/lu
mportantly it seems to require a
> custom build of Python, which I don't want.
I have no idea why you say that, for neither of the two.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Arnaud Delobelle, 02.09.2012 21:17:
> On 2 September 2012 19:42, Stefan Behnel wrote:
>> Arnaud Delobelle, 02.09.2012 20:34:
>>> On 2 September 2012 10:49, Arnaud Delobelle wrote:
>>>> On 2 September 2012 10:39, Alec Taylor wrote:
>>>>> http://pypi.p
; Lille is located in the north of france at the border to Belgium
> one hour from Paris, 1h20 from London, 35 min from Brussels, by train.
And the most important thing (which you forgot to mention): a nice place to
live.
> French food, combined with belgian beer.
Well, yes, but it's still a nice place to live.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
t makes the comparison (which may or may not be biased towards his
own engine) a bit less interesting. Worth keeping this in mind:
http://www.codeirony.com/?p=9
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
atabase you get your list and can easily
> cache it. The next call IS without impact that database call may
> cause... but you still keep serving pages out...
Well, if it was really that easy, you wouldn't be using a database in the
first place but static pages, would you?
Stefan
stackoverflow, you may also consider switching
from ctypes to Cython. It makes these things a bit more straight forward.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
mplementation almost a month
ago! ;)
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Christian Heimes, 29.09.2012 16:06:
> From now on you can't rely
> on the order of an unordered type like dict or set.
Tautologies tend to be true even without a temporal qualification.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
n the code base.
The lxml.cssselect package was moved into a separate PyPI project nicely
extended and maintained by Simon Sapin.
If you are interested in commercial support or customisations for the lxml
package, please contact me directly.
Have fun,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 2239 matches
Mail list logo