On Mon, 5 May 2008 16:05:08 +0200, Simon Posnjak <[EMAIL PROTECTED]> wrote:
On Mon, May 5, 2008 at 3:48 PM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
On Mon, 5 May 2008 15:41:08 +0200, Simon Posnjak <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I have a C module for whi
b.glob(os.path.join(os.path.join(basedir,picdir),'*'))
Question is, is there a better way of doing this? The above *works* but
it looks kinda hackish...
How about not nesting the calls?
>>> from os.path import join
>>> join(join('x', 'y'), 'z
ist and not trigger the "Unhandled error in
Deferred" message?
You can do this (if you replace `pass´ with `None´, anyway) or you can
pass `consumeErrors=True´ to the `DeferredList´ initializer which will
make it do something equivalent.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ertificate for
authentication unlike what i want to do.
Anyone has any ideas ?
FWIW, though not as complete as an OpenSSL wrapper as M2Crypto, pyOpenSSL
works with Python 2.3.
As far as the details of the authentication that you are attempting go, it
sounds like you want to use ephemeral DH key
ython extension. also, i don't have Vista.
Thanks
If you use Twisted, then you can use I/O Completion Ports, which are even
better than WSAPoll, and your code will also work with KQueue on BSD or
EPoll on Linux without any changes. :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 6 May 2008 08:44:36 -0700 (PDT), Giles Brown <[EMAIL PROTECTED]> wrote:
On 6 May, 14:18, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
On Tue, 6 May 2008 08:36:28 -0400, inhahe <[EMAIL PROTECTED]> wrote:
>select.poll isn't supported on Windows, because W
/howto/servers.html
which gives a brief overview of writing TCP servers with Twisted.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ume the Python process with the "fg" command, it will immediately
end since it has be killed.
This is more a Linux/bash/etc question than a Python question, so followups
might be directed to a more appropriate forum (eg, the man page for your
shell, or a bash user group, etc).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
condition3):
stmt1
stmt2
stmt3
stmt4
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
).get_components()
When I run this, I get:
[('C', 'ZA'), ('O', 'Thawte Consulting (Pty) Ltd.'), ('CN', 'Thawte SGC CA')]
[('C', 'US'), ('ST', 'California'), ('L', 'Mountain View'), ('O', 'Google
Inc'), ('CN', 'www.google.com')]
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
website.com')
urllib.urlopen gives you a file-like object for a resource at an url.
file gives you a file-like object for a file on the local filesystem.
soup = BeautifulSoup(file('/the/name/of/the/file'))
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
27;re writing to the socket which you get from accept (if the code
could get that far).
What are you trying to do? Why are you connecting and accepting? Why do
you need two threads?
Have you seen Twisted? http://twistedmatrix.com/
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 23 Aug 2008 02:25:17 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
I'd like to read and write the same socket in
ion, or I would
just use
for x in ...
Use the magical second parameter to the `iter´ builtin:
for x in iter(next, END):
...
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
their own values to the object thing?
eval and exec are the same. Don't use either with strings from a web page.
Try using a simple format for you data, such as CSV.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
eful. It sounds like the change is just making the failure
case more obscure and less likely to be noticed during testing, though.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
This could be a bug in the upgrade from a previous version of Ubuntu
installed on the host or perhaps you have a different Python 2.
t;
"not include line breaks or tabs "
"from the source file between "
"the strings partitions.")
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
be used in code. It was added to help newbies to 'escape' from an
interactive Python shell.
It works. Why shouldn't it be used?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
;m doubtful on how
much of a difference it would make for real Python programs (which,
simplifying a bit, tend to use loops instead of recursion).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
developers fixing its bugs and making it
work well. What are you trying to do that would make Apache a bad choice?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
l be used in the
future (either by you or by someone else, perhaps someone you've never
even met at the time you write the code).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
a simple matter of programming to *make* the buildmaster capable
of doing the slave's job, but there's not really any reason to try to
do this).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
> NUL
I'm not sure how to use it in python though.
Check out os.devnull. You can open it and write to it.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ssed after which a response object
is serialized and sent back to the client to complete the transaction.
You might be interested in Perspective Broker:
http://twistedmatrix.com/projects/core/documentation/howto/pb-intro.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
b/python/ or the equivalent
for your platform/installation.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
st():
"""
Return an XML string that looks like this::
123
D
...
@return: XML string.
"""
[EMAIL PROTECTED]:~$ epydoc test.py
Importing 1 modules.
[.]
Building API documentation for 1 modules.
[.]
Writing HTML docs (10 files) to 'html'.
[..]
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
hat the atomic operation takes fewer
than that many opcodes.
Spelling "do not switch threads" as sys.setcheckinterval(None) seems somewhat
natural, though. Perhaps that would be a fruitful direction to explore.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
dejavu, etc...
>
>Google results:
>Sqlobject ORM: about 17,100
>PyDO ORM: 469
>SQLAlchemy ORM: 571
>dejavu ORM: 659
>
axiom orm: about 21,500
Although "axiom" is not exactly unique. How about:
divmod axiom: 34,500
Huh.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
and, for things like u'\u0565\u0582' (ARMENIAN SMALL LIGATURE ECH YIWN), it
does not even work.
>
>:-)
>Unicode? I'm just a benighted Anglo from the a**-end of the globe; who
>am I to be preaching Unicode to a European?
>(-:
Heh ;P Same here. And I don't
0): x += 'x'"
10 loops, best of 3: 33.2 msec per loop
$ python -m timeit -s "x = ''" "for i in xrange(100): x += 'x'"
10 loops, best of 3: 347 msec per loop
$ python -m timeit -s "x = ''" "for i in xrange(1000): x += 'x'"
10 loops, best of 3: 3.48 sec per loop
$
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
2. Form handling in Nevow
>
http://divmod.org/trac/browser/trunk/Nevow/examples/formbuilder
http://forms-project.pollenation.net/cgi-bin/trac.cgi
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
#x27;Hell=C3=B3=20world'
>>> u'Helló world'.encode('punycode')
'Hell world-jbb'
>>>
Note the extra trip through utf-8 for quoted-printable, as it is not
implemented in Python as a character encoding, but a byte encoding, so you
cannot (safely) apply it to a unicode string.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
dling etc.
>(my be it the time some nevow know guy got onto it)
>
You might want to ask on the twisted web mailing list, then.
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
p
>
This is much slower than strText[::-1] (or any other squence), but which also
isn't in-place.
In-place operations on strings aren't support. You may want to consider a
different datatype if this is important. For example, an array of characters.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
none telling me how to do it in my
>own programs. Do you have any bookmarks ??
Here's one way:
<http://twistedmatrix.com/projects/core/documentation/howto/plugin.html>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
via ITransport.writeSequence (silently
falling back to writing "".join(iovec) if a more efficient scatter-gather
mechanism is not available (which it isn't in any of the official Twisted
reactors (but someday it will be and your program will magically go faster))).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
on(self, args):
...
return result
stdio.StandardIO(server.Site(YourApplication()))
reactor.run()
For more details, see <http://twistedmatrix.com/>.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
d here because getting a real reference from a weakref increases a
> reference counter. Maybe another option would be to store reference
> counters not in objects, but in a separate array to minimize number of
> memory pages they occupy...
It might be interesting to try with Jython or PyPy.
ng to have them drag you down. Fortunately the PyPy team is
making great progress in implementing a runtime that transparently
sheds
those dynamic features when running a program that doesn't take
advantage
of them.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
und.
When running as root, or when running on Windows, twistd does not add
the working directory to sys.path.
So with all that in mind, the solution should be pretty clear - just
set PYTHONPATH to include MyServerApp.
This variation of twistd behavior is pretty confusing, and I think a
future ver
completely accurate. It *is* possible to write a JIT
compiler
for a Python runtime which has fast path code for the common case, the
case
where the meaning of "+" doesn't change between every opcode. PyPy
has
produced some pretty good results with this approach.
For those who haven't seen it yet, http://speed.pypy.org/ has some
graphs
which reflect fairly well on PyPy's performance for benchmarks that
are not
entirely dissimilar to real world code.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 9, 8:15 pm, Paulo da Silva
wrote:
> Hi.
>
> Is there a python library/module to handle both the server and client
> sides of dns protocol?
>
> I have googled for it but I only found client side ones (at least from
> the superficial readings I did).
>
> Thanks.
Twisted Names is one such lib
cts, however, is an issue of larger scope than mere portability.
> ;)
>
The PyPy JIT supports x86_64. It's still being improved, but it does
provide real speedups in some cases already.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
e tooking too much time, which
> > > solution do you propose?
>
> > If possible, use multiple processes instead.
>
> > Diez- Nascondi testo citato
>
> > - Mostra testo citato -
>
> Multiple processes, ok, but then regarding processes' interruption
> there will be the same problems pointed out by using threads?
>
No. Processes can be terminated easily on all major platforms. See
`os.kill`.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 3, 4:17 pm, Adam Skutt wrote:
> On Jan 3, 4:06 pm, Jean-Paul Calderone
> wrote:
>
>
>
> > > Multiple processes, ok, but then regarding processes' interruption
> > > there will be the same problems pointed out by using threads?
>
> > No.
On Jan 3, 6:17 pm, Adam Skutt wrote:
> On Jan 3, 5:24 pm, Jean-Paul Calderone
> wrote:
>
> > Of course. The whole point here is not about threads vs processes.
> > It's about shared memory concurrency vs non-shared memory
> > concurrency. You can implement
On Jan 4, 12:31 pm, Fuzzyman wrote:
> On Jan 4, 3:31 pm, Roy Smith wrote:
>
>
>
> > In article
> > <2ebc11a5-1b45-4faa-97b9-c84f0db01...@k22g2000yqh.googlegroups.com>,
>
> > Fuzzyman wrote:
> > > It is unsafe to terminate an os level thread at an arbitrary point
> > > because it may be executin
ave a module named "foo" that defines
an "application" name, you would pass "foo.application".
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 1, 2:01 pm, Gelonida wrote:
> On 02/01/2011 03:07 AM, Jean-Paul Calderone wrote:
>
>
>
> > On Jan 31, 5:28 pm, Gelonida wrote:
> >> Hi,
>
> >> Normally I use following code snippet to quickly test a wsgi module
> >> wit
by the first router that sees them). You
just need to make a different decision at the first hop. You can do
this with the SO_BINDTODEVICE option on a raw socket. But this
probably also requires administrative privileges.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
://docs.python.org/library/socket.html#socket.AF_UNIX
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ltiple interpreters in a single process.
However,
you cannot have your cake and eat it too. If you create multiple
interpreters,
then why do you think you'll be able to share objects between them for
free?
In what sense would you have *multiple* interpreters in that scenario?
You will need some
On Feb 8, 7:12 pm, Paul Rubin wrote:
> But the refcount scheme is just an implementation hack
> that gets rationalized way too much. I hope PyPy abandons it.
Done. :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
from possible bugs where the data gets corrupted by the
code
that operates on it, since there's only one copy shared amongst all
your
tests. Is there some other benefit that the shared memory approach
gives
you?
Of course, adding unit tests that exercise your code on a smaller data
set
migh
On Feb 10, 12:21 pm, "Charles Fox (Sheffield)"
wrote:
> On Feb 10, 3:43 pm, Jean-Paul Calderone
> wrote:
>
>
>
>
>
>
>
>
>
> > On Feb 10, 9:30 am, "Charles Fox (Sheffield)"
> > wrote:
>
> > > Hi guys,
> > >
On Feb 11, 5:52 am, "Charles Fox (Sheffield)"
wrote:
> On Feb 10, 6:22 pm, Jean-Paul Calderone
> wrote:
>
>
>
>
>
>
>
>
>
> > On Feb 10, 12:21 pm, "Charles Fox (Sheffield)"
> > wrote:
>
> > > On Feb 10, 3:43 pm,
le your socket I/O asynchronously; but I don't enough about Python to
> get the mixed behavior you'd want.
>
> I think that there's an asynchronous all-Python MySQL library, but I'm not
> sure. Maybe one day I can open source my asynchronous MySQL C library. (I
> always recommend people to use PostgreSQL, though; which is superior in
> almost every way, especially the C client library and the wire protocol.)
There's the very new <https://github.com/hybridlogic/txMySQL>.
There's also
<http://pypi.python.org/pypi/txpostgres>.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ends how and why it
happens, and whether it prevents your application from working
properly.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
an https server, that
> supports wsgi modules
>
> TIA
You could do this with Twisted:
twistd -n web --https 443 --certificate server.pem --privkey
server.key --wsgi your.application
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
why, rather than
> waiting until all the tests are done.
>
> I've searched the doc and even looked at the code, and it seems the
> answer is no, but I'm just wondering if I'm missing something.
>
> Thanks!
>
> Margie
trial (Twisted's test runner) has
, the people responsible for how CPython builds on Windows
don't seem to consider this an issue.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 12 Jun 2009 22:54:14 +0900, David Cournapeau wrote:
On Fri, Jun 12, 2009 at 9:50 PM, Jean-Paul Calderone wrote:
On Fri, 12 Jun 2009 11:33:36 GMT, Alan G Isaac wrote:
On 6/12/2009 5:55 AM Virgil Stokes apparently wrote:
Any suggestions on installing matplotlib for Python 2.6.2 on a
bout APIs and ctypes deals with ABIs.
http://pypi.python.org/pypi/ctypes_configure/0.1 helps with the problem,
and is a bit more accessible than gccxml.
It is basically correct to say that using ctypes without using something
like gccxml or ctypes_configure will give you non-portable code.
Jean-Paul
7;t a good way to make a web server with Twisted. Take a look at
http://twistedmatrix.com/projects/web/documentation/howto/using-twistedweb.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
x.com/trac/
http://twistedmatrix.com/projects/core/documentation/howto/servers.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
that rely
on technical details you know nothing about?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ureCanvas(fig)
canvas.set_size_request(640, 480)
fig.savefig("foo.png")
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
with whichever versions of Python you want to support.
Tools like Hudson (<https://hudson.dev.java.net/>) and BuildBot
(<http://buildbot.net/>) can help with this.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
e)
With the result of BarGonk.frobnicate.__doc__ being set to:
Frobnicate this gonk.
This implementation takes the warble into consideration.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
following paper:
Yes, it'd be good for Python to expose setresuid. The best course of
action is to file a ticket in the issue tracker. Things will be sped
along if you also attach a patch implementing the change. :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
d somehow prevent I/O from
being serviced? I'm not sure why, as long as the implementation pays
attention to I/O events.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
y2exe doesn't really change the performance characteristics of a Python
application at all - for better or for worse.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ded to let OpenSSL make the decision about whether
to accept the certificate or not.
Either M2Crypto or pyOpenSSL will let you ignore verification errors. The
new ssl module in Python 2.6 may also as well.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 30, 9:08 am, David wrote:
> On Wed, Sep 29, 2010 at 6:49 PM, John Nagle wrote:
> > Python's signal handling for multithread and multiprocess programs
> > leaves something to be desired.
>
> Thanks for the confirmation (that I'm not missing something obvious).
>
> I've reported a bug for
t, but appreciate any/all advice)
>
Linux has /proc/self/fd and OS X has /dev/fd. Those both suppose you
have some way of determining which file descriptor corresponds to the
socket or sockets that the library is using, of course. Vastly better
would be to convince the author to expose that information via a real
API.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 1, 10:35 am, Antoine Pitrou wrote:
> On Thu, 30 Sep 2010 07:01:09 -0700 (PDT)
>
> Jean-Paul Calderone wrote:
>
> > But signal dispositions are inherited by child processes. So you run
> > ping from your short Python program, and it inherits SIGPIPE being
> >
On Oct 29, 10:08 am, Adam Tauno Williams
wrote:
> signal handler to do something smart in the case of a "-15" [for which
> there isn't really a thread equivalent - can you sent a SystemV style
> signal to an individual thread in a process? I don't think so.]
Yes
gt; page:
>
> https://launchpad.net/pyopenssl/main/0.11
>
It was helpfully pointed out to me that I forgot to mention that the
Python 3.2
support in this release of pyOpenSSL was made possible by a grant from
the Python
Software Foundation.
> Enjoy,
> Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
d calls with an IP address. If
you're not passing an IP address here, then the Python version has to
do a name lookup for each send, I bet your C version is not.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 10, 9:23 pm, Tim Roberts wrote:
> Mag Gam wrote:
>
> >I am measuring the round trip time using tcpdump. The C version is
> >giving me around 80 microseconds (average) and the python is giving me
> >close to 300 microseconds (average).
>
> If you need the performance of a compiled language,
GitHub for issues and source control
<https://github.com/twisted/txaws> (https://github.com/twisted/txaws).
Since the last release, the following enhancements have been made:
- Jean-Paul Calderone added basic Route53 support.
- Mark Williams add Auth v4, now used by the S3 an
://pypi.python.org/pypi>.
You can contribute to its development on GitHub
<https://github.com/LeastAuthority/txkube>.
Thanks to Least Authority Enterprises <https://leastauthority.com/> for
sponsoring this development.
Jean-Paul Calderone
http://as.ynchrono.us/
--
https://mail.python.org/mailman/listinfo/python-list
yPI <https://pypi.python.org/pypi/kubetop> and
GitHub <https://github.com/LeastAuthority/kubetop>. Install it in the
usual way:
pip install kubetop
Thanks to Least Authority Enterprises <https://leastauthority.com/> for
sponsoring this development.
Jean-Paul Calderone
http
601 - 684 of 684 matches
Mail list logo