to format it automatically you can either define a
VBA macro or use python com.
Cheers,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
prise.adbapi,
which wraps the module in an asynchronous API (implemented using a
thread pool).
Since the calls all happen in separate threads, it doesn't matter that
they block.
If you're not talking about a SQL database or a DB-API module, maybe
be more
specific about the kind o
10 bytes enough to thwart your attackers? Hard to say, what does
an attack look like?
If you want the full 16 bytes of unpredictability, why don't you just
read 16 bytes from
/dev/urandom and forget about all the other stuff?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
for
> each number.
>
> Uuid apparently uses machine internals etc etc to try and produce randomness,
> but urandom and similar can block so are probably not entirely suitable.
/dev/urandom does not block, that's the point of it as compared to /
dev/random.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
e iteration to the next,
> so a complete name lookup is required at each iteration. This is very
> useful sometimes, but affects performance a lot.
>
And even the original example, with only + and * can have side-
effects. Who knows how a defines __add__?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ty certificates". `wrap_socket` accepts a
`ca_certs` argument. See
http://docs.python.org/library/ssl.html#ssl-certificates
for details about that argument.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 6, 4:44 am, AndDM wrote:
> On Jul 5, 4:08 pm, Jean-Paul Calderone
> wrote:
>
>
>
> > On Jul 5, 4:52 am, Andrea Di Mario wrote:
>
> > > Hi, I'm a new python user and I'm writing a small web service with ssl.
> > > I want us
not sure what the listDeferred is there for.
Deferreds are a good abstraction for "do one thing and then tell
me what the result was". You have a different sort of thing here,
where there isn't much of a result (sending to tcp probably always
works until you lose your connection). A method call works well
for that.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
d behavior.
>
C and C++ have standards, and the standards describe what they don't
define.
Python has implementations. The defined behavior is whatever the
implementation does. Until someone changes it to do something else.
It's not much of a comparison.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
an CPU bound
>
> Threads are also useful for user interaction (i.e. GUI apps).
>
I suppose that's why most GUI toolkits use a multithreaded model.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
quot;Exactly one of a, b, c or d must be true.")
>
> I guess I never thought about it, but there isn't an 'xor' operator to
> go along with 'or' and 'and'. Must not be something I need very often.
>
You also can't evaluate xor without ev
his. Your server accepts arbitrary code from clients and
executes it. It is completely insecure. Do not use pickle and
sockets together. Notice the large red box at the top of .
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
mport TestCase
from twisted.test.proto_helpers import StringTransport
from yourapp import Handler # Or a better name
class HandlerTests(TestCase):
def test_someMessage(self):
"""
When the "X" message is received, the "Y" response is sent
back.
"""
transport = StringTransport()
protocol = Handler()
protocol.makeConnection(transport)
protocol.dataReceived("X")
self.assertEqual(transport.value(), "Y")
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ese PEPs to provide compliant packages.
> While its not that important for pure-python modules, anything tied to
> C-API better be documented, or it becomes a nightmare to keep
> non-CPython version having identical interface.
>
Unit tests actually serve this purpose much better than do PE
>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.connect(('1.2.3.4', 1234))
>>> s.getsockname()
('192.168.1.148', 47679)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
m the messages in this thread if you managed to
get
that approach working. The most commonly encountered problem with
this
approach is that it means that any blocking (eg I/O) operation in
progress
won't be interrupted and you'll have to wait for it to complete
normally.
In this case, it soun
results = "_" + results
> return results
>
> but if somebody already has war-hardened code they'd be willing
> to share, I'd appreciate any thoughts.
>
There's http://pypi.python.org/pypi/filepath/0.1 (taken from
twisted.python.filepath).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
anks to everyone who contributed and to Least Authority TFA GmbH
<https://leastauthority.com/> for sponsoring my work on this release.
Jean-Paul
--
https://mail.python.org/mailman/listinfo/python-list
nd fix this issue and to publish this new
release.
Jean-Paul
--
https://mail.python.org/mailman/listinfo/python-list
thon.org/pypi>
You can contribute to its development on GitHub
<https://github.com/LeastAuthority/txkube>.
Thanks to Least Authority TFA GmbH <https://leastauthority.com/> for
sponsoring this development and to Craig Rodrigues for his efforts on
Python 3 porting work.
Jean-Paul
u have, as well as details of your availability and any
related work you have done previously (GitHub, LinkedIn links, etc). If you
would like to find out more about this opportunity, please contact us at
jessielisbetfrance at gmail (dot) com or on IRC in #tahoe-lafs on Freenode.
J
On 26 Oct 2005 06:15:35 -0700, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>> I want to convert from pickle format to python source code. That is,
>> given an existing pickle, I want to produce a textual representation
>> which, when evaluated, yields the original object (as if I had
>> unpickled
at
this is actually a premature optimization.
I bet there are much more interesting problems to be solved in
this project, ones that you could work on and test, even while
doing something as unbelievable slow as looping over 100 or so
objects. ;)
You can always optimize later, after you've
On Fri, 28 Oct 2005 00:17:54 +0800, "Neville C. Dempsey" <[EMAIL PROTECTED]>
wrote:
>Why does this python program fail to read record "600"?
>
>#!/usr/bin/env python
>import bsddb # twiceopen.py
>
>key="600"
>btf=bsddb.db.DB_INIT_THREAD
>
>list1=bsddb.btopen("twiceopen.tbl",btflags=btf)
>l
390097
http://article.gmane.org/gmane.comp.python.general/389011
http://article.gmane.org/gmane.comp.python.general/334625
I could go on for a while longer, but hopefully some of the linked material
will answer your question.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
whether
the connection was dropped because the file was fully transferred or because of
some transient network problem or other error. One solution to this is to
prefix the file's contents with its length.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
es there? Josh
>> You may pass, Josh
>>
>> I'm assuming s=Josh...but that is not included in the statement at all
>> I don't know how you put "Josh" in or how you got it to finish running
>> w/o hitting enter after "Who goes there?"
>>
>> What am I doing wrong?
Did you try typing "Josh" and then enter? Or any other name, for that matter...
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
g system's
capabilities to limit resource access and usage on a per-process. That is, run
each piece of submitted code in a separate, unprivileged process, with the
appropriate limits in place.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
s.py>).
By only encoding and decoding at the border between your application and the
outside world, and the border between your application and the data, you will
eliminate the possibility for a class of bugs where encodings are forgotten, or
encoded strings are accidentally combined with unicode strings.
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
x27;t think
it's maintained anymore.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ole as a sentinel, obviously.
This is a reasonable trick, though:
class sentinel:
pass
Now sentinel pickles and unpickles in a manner which agrees with the above
pattern without any extra works.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
rward. I'll probably do it myself when I have
> the time or the motivation.
>
Like this?
http://cvs.twistedmatrix.com/cvs/trunk/twisted/conch/insults/insults.py?view=markup&rev=14863
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
gt; File "", line 1, in ?
>AttributeError: 'module' object has no attribute 'paramstyle'
> >>>
The DB-API2ness is at pysqlite2.dbapi2:
>>> from pysqlite2 import dbapi2
>>> dbapi2.paramstyle
'qmark'
>>> dbapi2.threadsafety
1
>>>
etc. :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ags.meta(**{"http-equiv": "refresh", "content": "0;calc"})]])
def child_calc(self, ctx):
return LongTaskPage(ICalculator, Adder())
application = service.Application("Push Mechanism, like back in '97")
webserver = internet.TCPServer(8080, appserver.NevowSite(Root()))
webserver.setServiceParent(application)
# eof
Right? But maybe you can explain why, for those of us who aren't enlightened.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
o the end user.
What's to stop someone from publishing the decrypted code online for anyone to
download?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
t'll probably work with IE in an upcoming
release, though.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
able failures as to make it cost more
time than it saves. You really want to stop the rest of the program, then
update things, then let everything get going again.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
it again. Anyway, I was hoping someone
>on c.l.p / python.org would have a reliable reference on
>this.
I'm not sure which claim you read, but perhaps it was in reference to PyXPCOM?
<http://aspn.activestate.com/ASPN/Downloads/Komodo/PyXPCOM/>
I'm not quite sure if you are
catch it during their testing >:) If you return an error code
instead, they are just as likely to pass in bad data, and even *more* likely to
not see that an error has occurred, causing their programs to be incorrect.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
.
>
>Inspired by http://www.python.org/pycon/2005/papers/7/pyconHooking.html
You may want to look at a few existing Python plugin systems. To get you
started, here's a link to the Twisted plugin system documentation:
<http://twistedmatrix.com/users/warner/doc-latest/core/howto/plugin.html>
suspect you don't. If you really
did, you may want to pick up one of those platitude-filled XP books
and give it a careful read. You may find there's more there than
you were previously aware.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
kling will fail. You can raise this limit, to a point,
with sys.setrecursionlimit().
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
lp. The above example basically teaches
the copy_reg module how to give the pickle module the help it needs for
code objects.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
to the email
>package, if a satisfactory one can be written; i would definitely support
>their doing that.
The top part of
<http://divmod.org/users/viewcvs.twistd/branches/exarkun/smtp-2418/quotient/proto/smtp.py?rev=7661&view=markup>
contains a parser that, IIRC, is basica
mpletion()
return result
def write(self, bytes):
return self.wrappedReceiver.write(bytes)
Hook it up to a Realm and a Portal and override uploadCompleted to taste and
you've got an FTP server that should do you (granted, it's a little long - some
of this code
, complex2):
res = Complex(self.real + complex2.real, self.imag + complex2.imag)
return res
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ause I thought you were tied to FTP.
If you actually have security concerns, you might want to use SFTP instead
(which Twisted also supports, but to which the code I sent is only partly
applicable).
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
The
*only* things it tells me about are modules that are imported but never used
and names that are used but not defined. It's false positive rate is something
like 1 in 10,000.
>
>Is there a tool that simply scans each module and updates the import
>statements, subject to my app
On Sat, 10 Dec 2005 13:40:12 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>> On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway
>> <[EMAIL PROTECTED]> wrote:
>>> How about PyLint / PyChecker? Can I configure one of them to te
On Sat, 10 Dec 2005 11:54:47 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>> On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>>>How about PyLint / PyChecker? Can I configure one of them to tell me
>>
uot;,)
>>> type(t2)
>>> t3 = "blah",
>>> type(t3)
>>>
It's the comma that makes it a tuple. The parenthesis are only required in
cases where the expression might mean something else without them.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
de that mostly calls
>into C libraries that release the GIL. For example, a threaded spider
>scales nicely on SMP.
Yes. Nearly as well as a single-threaded spider ;)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
tion("News Site")
webserver = appserver.NevowSite(NewsIndex(cp))
internet.TCPServer(80, webserver).setServiceParent(application)
# Run with twistd -noy
For more information about Nevow, checkout the Wiki -
<http://divmod.org/trac/wiki/DivmodNevow> - or the mailing list -
<http://twist
On 18 Dec 2005 12:27:55 -0800, [EMAIL PROTECTED] wrote:
>Hi Jean-Paul,
>
>I am a bit lost in you code. Is it possible for you to step through
>it?
For in depth-assistance, it would probably be best to continue on [EMAIL
PROTECTED] You might also want to check out some of the lin
7;t a web
framework, though it includes an HTTP server.
>Webware : Python licence
>Zope : ZPL (Zope Public Licence)
>
>There doesn't seem to be an obvious choice, but the GPL isn't used much
>here
>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
.
You might also address it as a deployment issue, and run fewer programs on the
host in question, or reboot it more frequently.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ple pieces, pass parts of it around as real, live objects with
introspectable APIs, allow for mutation of portions of the query,
re-arrange it, etc. All this is possible with strings too, just way
harder :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
seg(x):return urllib2.urlopen('http://7seg.com/'+x).read()
>>
>And another one from me as well.
>
>class a:
> def __eq__(s,o):return 1
>seven_seg=lambda i:a()
>
This is shorter as "__eq__=lambda s,o:1".
But I can't find the first post in this thread... What are you
guys talking about?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
rue,
outlineColor=(1, 1, 1),
fillColor=(0, 0, 0.25)):
...
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
or like this:
import copy
tmp = copy.copy(myList)
This is as opposed to a deep copy, which is like this:
import copy
tmp = copy.deepcopy(myList)
What "tmp = myList" does is to create a new *reference* to the
very same list object.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
bit processor, and Python ints appear to be 64-bit as well, so even
>if len() only works with ints, it should still be able to handle 64-bit
>values.
Conspicuous timing:
<http://mail.python.org/pipermail/python-dev/2005-December/059266.html>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
seHTTPServer in the standard library
will address /this/ particular issue (there are lots of other solutions, too,
not just these four). Some of them may address other issues better or worse
than others.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
he list calling
join on each one. join will block until the thread's function
returns.
>
> # How do I print "order" after all the threads are complete?
> print "\nThreads were processed in the following order:"
> for i, person in enumerate(order): print "%d. %s" % (i+1,person)
>
>if __name__ == "__main__":
> main()
>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ne 10, in testSomeName
self.assertEquals(x.someName, "bye")
twisted.trial.unittest.FailTest: 'hello' != 'bye'
-
Ran 1 tests in 0.278s
FAILED (failures=1)
[EMAIL PROTECTED]:~$
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
d -- hence the funny interface
for lock, where a function is called once the lock is aquired.
If you are looking for a mutex suitable for multithreaded use, see the
threading module.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
its" or "license" for more information.
>>> import sys
>>> sys.setrecursionlimit(10)
__main__:1: DeprecationWarning: integer argument expected, got float
>>> (lambda f: f(f))(lambda f: f(f))
Segmentation fault
[EMAIL PROTECTED]:~$
I could probably dig up a few more, if you want. So what's ctypes on top of
this?
Jean-Paul
>
>Neil
>--
>http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
It's
important to keep the two kinds of tests separate. Integration
tests are great for telling you that something has gone wrong,
but if you get rid of all your unit tests in the process of writing
integration tests, you will have a more difficult time determining
*what* has gone wrong.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
r, it
won't work for anything:
>>> iter(5)
Traceback (most recent call last):
File "", line 1, in ?
TypeError: iteration over non-sequence
This is "duck typing" in action.
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
#x27;) will do the same job without the security
>hole:
Using marshal at all introduces a similar security hole, so security is not an
argument against repr()/eval() in this context.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
re a multiple of the filesystem block size, would it guarantee
reads on block-boundaries (where possible)?
* How would it handle EOF? Would it stop iterating immediately after the
first short read or would it wait for an empty return?
* What would the buffering behavior be? Could one interlea
e on a platform with statvfs(2):
>>> import os
>>> s = os.statvfs('/')
>>> s.f_bavail * s.f_bsize
59866619904L
>>>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
+ a
else:
a = _x
else:
a = b + a
else:
if hasattr(a, '__iadd__'):
_x = a.__iadd__(b)
if _x is NotImplemented:
a = b + a
else:
a = _x
else:
a = b + a
Roug
On 20 Jan 2006 06:01:15 -0800, datbenik <[EMAIL PROTECTED]> wrote:
>How can i write a program that supports simultaneous multipart
>download. So i want to open multiple connections to download one file.
>Is this possible. If so, how?
http://twistedmatrix.com/
>
>--
>http://mail.python.org/mailman
s, they will fail
and you will know you need to fix your code.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ple: thread receives a
>message, stops everything, and processes the message.
>
And what happens if the thread was halfway through a malloc call and
the data structures used to manage the state of the heap are in an
inconsistent state when the interrupt occurs?
This has been discussed m
On Mon, 24 Jul 2006 13:51:07 -0700, "Carl J. Van Arsdall" <[EMAIL PROTECTED]>
wrote:
>Jean-Paul Calderone wrote:
>> On Mon, 24 Jul 2006 11:22:49 -0700, "Carl J. Van Arsdall" <[EMAIL
>> PROTECTED]> wrote:
>>
>>> Steve Ho
esolv.conf then the browsers only
>recognize the hosts we want
Twisted includes a DNS server which is trivially configurable to perform
this task. Take a look.
http://twistedmatrix.com/
http://twistedmatrix.com/projects/names/documentation/howto/names.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
the solution is simple: don't do things like this ;)
It is allowed at all because, to the runtime, "x.someattr = someval" is
no different from "self.someattr = someval". The fact that a different
name is bound to a particular object doesn't matter.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ack
>a backtrace in case of errors in the python code.
I think you'd have more luck with the traceback module, which has such
methods as format_exception and print_tb.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ising an exception in your own thread is pretty trivial. SIGALRM does
no good whatsoever here. :)
Besides, CPython will only raise exceptions between opcodes. If a
misbehaving thread hangs inside an opcode, you'll never see the exception
from SIGALRM.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
.gmane.org/gmane.comp.python.devel/82129
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
;>> list.append = lambda self, value: 'hello, world'
>>>> x = []
>>>> x.append(10)
'hello, world'
>>>> x
[]
>>>>
As alternate implementations become more widely used, it will be important
to nail down ex
combined with the fact that in Python you
/still/ cannot handle a signal until the interpreter is ready to let you
do so (a fact that seems to have been ignored in this thread repeatedly),
signals end up not being a solution to this problem.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
try:
return threading.Thread.run(self)
except Exception, e:
print 'Exiting', e
def main():
threads = []
for f in timeSleep, childSleep, catchException:
t = KillableThread(target=f)
t.start()
threads.a
p but lead to misunderstandings.
>to *really* suspend the stack at a given time and do a bunch of crazy
>stuff, but doesn't currently support 'full continuations'.
>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
l don't think meaningful indentation is good.
If your example were actually valid (which it isn't), all it would
demonstrate is that Python should be even stricter about indentation,
since it would have meant that there is still some whitespace which
has no meaning and therefore can be adjusted in meaingless ways by
each programmer, resulting in unreadable junk.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
k when all the other
# Deferreds in this list have been called back.
d = defer.DeferredList(completionDeferreds)
# And tell it to stop the reactor when it fires
d.addCallback(lambda result: allConnectionsLost())
# Start the reactor so things can start happening
reactor.ru
thod(fromPickleFile)
You can then use this like so:
inst = Obj.fromPickleFile('obj.dat')
Jean-Paul
>
>Anton
>--
>http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
On 12 Aug 2006 10:44:29 -0700, zxo102 <[EMAIL PROTECTED]> wrote:
>Jean-Paul,
>Thanks a lot. The code is working. The python twisted is new to me too.
>Here are my three more questions:
>1. Since the code need to be started in a wxpyhon GUI (either by
>clicking a button or up
On 12 Aug 2006 21:59:20 -0700, zxo102 <[EMAIL PROTECTED]> wrote:
>Jean-Paul,
>I just start to learn Twisted. Here is my simple case: I can find
>the data sent by clients in dataReceived but I don't know which
>client/which port the data is from. After I know where the
On 15 Aug 2006 10:06:02 -0700, KraftDiner <[EMAIL PROTECTED]> wrote:
>How can you tell if the host processor is a big or little endian
>machine?
>
sys.byteorder
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
nd from google searches are not really as
>> robust as I need them to be.
>
>Would email.Utils.parseaddr() fit the bill?
>
>http://docs.python.org/lib/module-email.Utils.html#l2h-3944
>
This is for RFC 2822 addresses.
http://divmod.org/trac/browser/sandbox/exarkun/smtp.
buf = ''
def dataReceived(self, bytes):
self.buf += bytes
exit = self.buf.find('exit')
if exit != -1:
self.transport.write(self.buf[:exit])
self.buf = self.buf[exit + 4:]
reactor.stop()
else:
self.transport.write(self.buf)
self.buf = ''
f = protocol.ServerFactory()
f.protocol = Server
reactor.listenTCP('192.168.1.101', 8080, f)
reactor.run()
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On 5 Oct 2006 07:01:50 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote:
> [snip]
>
>Jean-Paul many thanks for this and your effort.
>but why is it every time I try to do something with 'stock' python I
>need another package?
Maybe you are trying to do things that a
and AFAIK, the original urllib
>code is irreversibly overwritten. Am I right?
Mostly. However, Try importing urllib first, grabbing the open_https function,
then importing M2Crypto, then reversing what M2Crypto did by putting the
original open_https function back onto URLopener.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
opIteration:
... break
...
0
2
4
6
8
10
12
14
16
18
>
>Now, I was expecting that to be 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20.
>
>What am I missing here?
Your code was calling next and send, when it should have only been calling
send.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
7;header.html').read()
>
>Not quite as elegant as include('header.html'), but it seems like it
>would work.
def include(filename):
print open(filename).read()
include('header.html')
Behold, the power of a general purpose programming language.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
uccessful result. If all of your processing is synchronous,
then you simply need to return twisted.internet.defer.succeed(None) at the
end of the function. If you have asynchronous processing to do (it does not
appear as though you do), you will need to return a Deferred which only fires
once that processing has been completed.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
check the current time against the top element's time.
You could also use Twisted, which provides time-based primitives in addition
to supporting network multiplexing without threads.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 13 Oct 2006 18:44:35 +0200, Jan Bakuwel <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>
>> The return value of eomReceived is used to determine whether to signal to
>> the SMTP client whether the message has been accepted. Regardless of your
>>
1 - 100 of 684 matches
Mail list logo