On Thu, 01 Nov 2007 21:15:06 -, Aaron Watters [EMAIL PROTECTED] wrote:
On Nov 1, 4:59 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
On Thu, 01 Nov 2007 20:35:15 -, Aaron Watters [EMAIL PROTECTED] wrote:
On Nov 1, 2:15 pm, Raymond Hettinger [EMAIL PROTECTED] wrote:
On Nov 1, 4:45 am
On Wed, 31 Oct 2007 07:53:01 -0700, John Nagle [EMAIL PROTECTED] wrote:
I'm now getting messages like this from the Python bug tracker on
SourceForge:
Artifact: This Artifact Has Been Made Private. Only Group Members Can
View Private ArtifactTypes.
I'm being denied access to bug reports I
On Wed, 31 Oct 2007 08:26:06 -0700, John Nagle [EMAIL PROTECTED] wrote:
Jean-Paul Calderone wrote:
On Wed, 31 Oct 2007 07:53:01 -0700, John Nagle [EMAIL PROTECTED] wrote:
I'm now getting messages like this from the Python bug tracker on
SourceForge:
Artifact: This Artifact Has Been Made
On Wed, 31 Oct 2007 16:42:48 +0100, \Martin v. Löwis\ [EMAIL PROTECTED]
wrote:
I don't know why they chose to make the sf tracker private. Maybe that
was the only way to remove write access.
That, plus removing it means that people won't browse outdated information.
Though it also means all
Jean-Paul Calderone added the comment:
This isn't a bug in Python. Working directory, which os.chdir modifies,
is process-global. One of your threads makes a directory, then gets
suspended while another one makes a different directory and changes into
it, then the first tries to change
On Tue, 30 Oct 2007 14:09:39 -, Steven D'Aprano [EMAIL PROTECTED] wrote:
[snip]
(Aside: I think it a shame that there is one major paradigm that Python
doesn't have *any* support for at all: logic programming, like Prolog. I
don't quite know what it is good for, but I'd like to find out!)
On Tue, 30 Oct 2007 15:25:54 GMT, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-10-30, Eduardo O. Padoan [EMAIL PROTECTED] wrote:
This is a FAQ:
http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm
Holy Airy
On Tue, 30 Oct 2007 22:25:28 GMT, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Is there a Python library to communicate with a usenet server? I did a
bit of googling and found some sites that suggest that you can roll your own
fairly easily but, mostly, I got a lot of
On Mon, 29 Oct 2007 19:03:34 +0200, Hendrik van Rooyen [EMAIL PROTECTED]
wrote:
Tim Chase [EMAIL PROTECTED]
I think you are being a little bit unfair here: help(len) says:
len(...)
len(object) - integer
Return the number of items of a sequence or mapping.
which implies
On Thu, 25 Oct 2007 04:46:12 -, Josiah Carlson [EMAIL PROTECTED] wrote:
[snip]
But really, since I already wrote code that handles *all* of
the timeout handling with a *single* time.time() call, and that also
generally minimizes all explicit function calls, I'm not sure that
your testing
On Thu, 25 Oct 2007 04:00:44 -0700, Abandoned [EMAIL PROTECTED] wrote:
Hi..
I use the threading module for the fast operation.
For fast operation, avoid the threading module. Here's a code sample:
conn = connect(...)
cursor = conn.cursor()
cursor.executemany(INSERT INTO keywords
On Thu, 25 Oct 2007 09:46:54 -0500, Erik Jones [EMAIL PROTECTED] wrote:
[snip]
Fortunately, in his case, that's not necessarily true. If they do
all their work with the same connection then, yes, but there are
other problems with that as mention wrt thread safety and psycopg2.
If he goes the
New submission from Jean-Paul Calderone:
zipimporter instances have a read-only archive attribute, but there is
no documentation referring to it, nor any test coverage for its existence.
It's quite useful to know what a zipimporter is pointed at (for
debugging and other introspection). It'd
New submission from Jean-Paul Calderone:
It's possible to construct a zipimporter with a path which points
first to a zip file and then continues to refer to a file within that
zip file. For example,
/foo/bar.zip/baz
where /foo/bar.zip is not a directory, but a zip file, and baz is a file
Changes by Jean-Paul Calderone:
--
nosy: +fijal
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1325
__
___
Python-bugs-list mailing list
Unsubscribe:
http
Changes by Jean-Paul Calderone:
--
nosy: +fijal
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1326
__
___
Python-bugs-list mailing list
Unsubscribe:
http
Jean-Paul Calderone added the comment:
The APR comment is indeed correct, so this is probably a Python bug.
--
nosy: +exarkun
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue805194
On Wed, 24 Oct 2007 20:42:49 +0100, Sandy Dunlop [EMAIL PROTECTED] wrote:
Hi,
I'm new here, and fairly new to Python. I have been playing around with
Python and started having a look at socket IO. I have written a script
that communicates over a network to a server which is written in C.
While
On Wed, 24 Oct 2007 19:07:44 -, mrstephengross [EMAIL PROTECTED] wrote:
Hi folks. I'm using os.popen() to run a command; according to the
documentation, the filehandle.close() oepration is suppsoed to return
the exit code. However, when I execute something like exit 5,
close() returns 1280.
On Tue, 23 Oct 2007 14:47:40 +0200, Rene Maurer [EMAIL PROTECTED] wrote:
Hallo
I wonder if there are any pure python implementations available/known
for the zip (or any other) data compression... As far as I know
python's zlib uses http://www.zlib.net/, which is written in
C. Unfortunately this
On Tue, 23 Oct 2007 15:34:19 -, Josiah Carlson [EMAIL PROTECTED] wrote:
[snip]
Calling time.time() is relatively inexpensive in comparison to pure
Python function calls, but indeed, it could be a bottleneck.
Did you benchmark this on some system?
There isn't really any pure Python function
On Mon, 22 Oct 2007 09:44:27 + (UTC), Paul Brauner [EMAIL PROTECTED]
wrote:
[snip]
I thought that it must exists because everyone generating python code will
encounter more or less the same problem, but I didn't find any 'official'
thing on the subject.
I expect many projects which emit
On Sat, 20 Oct 2007 21:10:34 +0200 (CEST), sccs cscs [EMAIL PROTECTED] wrote:
Hello,
I cannot find into documentation how to get the instance name. I found the
attributes __dict__,__class__ ,__bases__ __name__ ,
but if i have the code:
class A :pass
a1 = A ()
a2 = A ()
aList = [a1,a2]
for elem
On Mon, 15 Oct 2007 20:52:11 +0200, Thomas Wittek [EMAIL PROTECTED] wrote:
Hi!
Is there any possibility/tool to automatically organize the imports at
the beginning of a module?
I don't mean automatic imports like autoimp does as I like seeing where
my objects/functions really come from.
For the
On Fri, 12 Oct 2007 14:59:13 -, Christoph Krammer [EMAIL PROTECTED] wrote:
Hello everybody,
I am using a python script to extract images from email messages. This
works fine for some messages, but not all attached images can be
decoded. I use the following code to decode the image and save it
On Fri, 12 Oct 2007 11:33:11 -0500, Erik Jones [EMAIL PROTECTED] wrote:
[snip]
This got me thinking about building a module that could be included
by projects that creates a socket and responds to messages on that
socket in a separate thread from the main app so that you can connect
to the app
On Wed, 10 Oct 2007 05:58:51 GMT, Alan Isaac [EMAIL PROTECTED] wrote:
I am on a Windows box.
I pickle a tuple of 2 simple objects with the pickle module.
It pickles fine. It unpickles fine.
I upload to a server.
I try to unpickle from the URL. No luck. Try it:
x1, x2 =
On Mon, 08 Oct 2007 23:00:46 GMT, John Nagle [EMAIL PROTECTED] wrote:
Chris Mellon wrote:
On 10/7/07, Michel Albert [EMAIL PROTECTED] wrote:
On Oct 6, 4:21 am, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Fri, 05 Oct 2007 04:55:55 -0300, exhuma.twn [EMAIL PROTECTED]
escribi?:
[...] What I
On 09 Oct 2007 17:45:12 +0200, Stefan Arentz [EMAIL PROTECTED] wrote:
Chris Mellon [EMAIL PROTECTED] writes:
On 09 Oct 2007 17:20:09 +0200, Stefan Arentz [EMAIL PROTECTED] wrote:
Is there an easy way to implement a specific method of a Python class
in C? Like a native method in Java? I
On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman [EMAIL PROTECTED] wrote:
[snip]
In this case I asked it as part of the original question and it was
ignored. I have programmed in C and C++ and a little Pascal many years
ago. I don't remember anything about Higher Order Functions and would
On Fri, 21 Sep 2007 20:16:29 +0200, David [EMAIL PROTECTED] wrote:
On 9/21/07, cyril giraudon [EMAIL PROTECTED] wrote:
Hello,
I 'd like to know if a std::setw() equivalent function exists in
python ?
i thought of something like :
a = 16
%ai % 12
But it is not correct.
Any Idea ?
(%i
New submission from Jean-Paul Calderone:
Python 2.5 deprecated raising string exceptions. It also added the
throw method to generator objects which can be used to raise an
exception, including a string exception. Raising an exception with this
method doesn't issue a deprecation warning
On Tue, 04 Sep 2007 00:32:23 -, Ben [EMAIL PROTECTED] wrote:
Here are the statistics from Google Trends:
http://benyang22a.blogspot.com/2007/09/perl-vs-python.html
From the graph, it seems more accurate to say that Perl is undertaking Python.
Jean-Paul
--
Jean-Paul Calderone added the comment:
Not likely, given the number of things on my plate already.
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1598083
_
___
Python
On Thu, 23 Aug 2007 11:22:55 -0600, darren kirby [EMAIL PROTECTED] wrote:
Hi all,
I have a strange error here and I am unsure how to further investigate it:
Python 2.4.4 (#1, Aug 23 2007, 10:51:29)
[GCC 4.1.2 (Gentoo 4.1.2)] on linux2
Type help, copyright, credits or license for more
On Wed, 22 Aug 2007 13:01:47 -, Greg Copeland [EMAIL PROTECTED] wrote:
On Aug 21, 9:40 pm, Bikal KC [EMAIL PROTECTED] wrote:
Greg Copeland wrote:
I'm having a brain cramp right now. I can't see to recall the name of
Is your cramp gone now ? :P
I wish. If anyone can remember the name
On Tue, 14 Aug 2007 21:45:51 +0300, Ghirai [EMAIL PROTECTED] wrote:
On Tue, 14 Aug 2007 18:27:16 GMT
Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-08-14, Ghirai [EMAIL PROTECTED] wrote:
I need to write a console application.
Are there any wrappers around curses/ncurses?
Or any other
On Fri, 10 Aug 2007 10:01:51 -, Justin T. [EMAIL PROTECTED] wrote:
Hello,
While I don't pretend to be an authority on the subject, a few days of
research has lead me to believe that a discussion needs to be started
(or continued) on the state and direction of multi-threading python.
[snip -
On Fri, 10 Aug 2007 16:37:19 -, Justin T. [EMAIL PROTECTED] wrote:
On Aug 10, 3:52 am, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
On Fri, 10 Aug 2007 10:01:51 -, Justin T. [EMAIL PROTECTED] wrote:
Hello,
While I don't pretend to be an authority on the subject, a few days of
research
On Thu, 09 Aug 2007 09:00:27 -, Justin T. [EMAIL PROTECTED] wrote:
Hi,
I've been looking at stackless python a little bit, and it's awesome.
My question is, why hasn't it been integrated into the upstream python
tree? Does it cause problems with the current C-extensions? It seems
like if
On Thu, 9 Aug 2007 05:05:31 -0700, Michael Bentley [EMAIL PROTECTED] wrote:
On Aug 9, 2007, at 4:48 AM, Jean-Paul Calderone wrote:
On Thu, 09 Aug 2007 09:00:27 -, Justin T.
[EMAIL PROTECTED] wrote:
Hi,
I've been looking at stackless python a little bit, and it's awesome.
My question
On Mon, 6 Aug 2007 10:06:51 -0400, Patrick Doyle [EMAIL PROTECTED] wrote:
Reading through the Python tutorial, I got to section 6.4.1,
Importing * From a Package, which states:
If __all__ is not defined, the statement from Sound.Effects import *
does not import all submodules from the package
On Mon, 06 Aug 2007 09:03:45 -0700, 7stud [EMAIL PROTECTED] wrote:
I'm trying to understand datagrams. My client program sends a message
to the server, and then the server infinitely loops over the recv() to
make sure all the data was received. I'm trying to use an * to signal
the end of the
On Thu, 02 Aug 2007 21:16:04 +0200, Diez B. Roggisch [EMAIL PROTECTED]
wrote:
vml schrieb:
Hello,
I am trying to promote python in my job, my collegue only see matlab
and microsoft scripting language.
I understood that there willl be no backward compatibility between
python 2.x and 3.0,
On Thu, 02 Aug 2007 23:07:12 +0200, Diez B. Roggisch [EMAIL PROTECTED]
wrote:
Jean-Paul Calderone schrieb:
On Thu, 02 Aug 2007 21:16:04 +0200, Diez B. Roggisch
[EMAIL PROTECTED] wrote:
vml schrieb:
Hello,
I am trying to promote python in my job, my collegue only see matlab
and microsoft
On Tue, 31 Jul 2007 07:34:09 -0400, Neal Becker [EMAIL PROTECTED] wrote:
I'm wondering if a generator that is within a 'with' scope exits the 'with'
when it encounters 'yield'.
I would like to use a generator to implement RAII without having to
syntactically enclose the code in the 'with' scope,
On Mon, 30 Jul 2007 15:48:00 +0200, Diez B. Roggisch [EMAIL PROTECTED]
wrote:
Neil Cerutti wrote:
On 2007-07-30, André [EMAIL PROTECTED] wrote:
On Jul 30, 9:39 am, Neil Cerutti [EMAIL PROTECTED] wrote:
I don't understand the qualification, at runtime, you're
making. What's wrong with just
On Mon, 30 Jul 2007 07:36:00 -0700, [EMAIL PROTECTED] wrote:
Hi,
[snip]
f=open(fileBeginning+.tmp, 'w')
f.write(Hello)
f.close
You forgot to call close. Try this final line, instead:
f.close()
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 22 Jul 2007 21:13:02 +0200, Peter Kleiweg [EMAIL PROTECTED] wrote:
Carsten Haese schreef op de 22e dag van de hooimaand van het jaar 2007:
On Sun, 2007-07-22 at 17:44 +0200, Peter Kleiweg wrote:
It's a feature. See help(str.split): If sep is not specified or is
None, any whitespace
On Thu, 19 Jul 2007 21:07:55 -0500, alf [EMAIL PROTECTED] wrote:
Hi,
I need a help with explaining following behavior. Although it is not
python issue per say, python helped me to write sample programs and
originally I encountered the issue using python software. So let's
assume we have two
On Fri, 20 Jul 2007 09:32:17 +0200, Hendrik van Rooyen [EMAIL PROTECTED]
wrote:
Walker Lindley wrote:
Right, I could use Pyro, but I don't need RPC, I just wanted an easy way to
send objects across the network. I'm sure both Pyro and Yami can do that and I
may end up using one of them. For the
On Fri, 20 Jul 2007 08:15:39 -0500, alf [EMAIL PROTECTED] wrote:
Jean-Paul Calderone wrote:
You can avoid this, if you like. Set FD_CLOEXEC on the socket after you
open it, before you call os.system:
old = fcntl.fcntl(s.fileno(), fcntl.F_GETFD)
fcntl.fcntl(s.fileno(), fcntl.F_SETFD, old
On Fri, 20 Jul 2007 08:27:13 -0700, Walker Lindley [EMAIL PROTECTED] wrote:
It doesn't interface well because the string you end up with often doesn't
fit into a single packet. Therefore you have to add a layer of protocol on
top of it that allows you to check to make sure you have the whole
On Fri, 20 Jul 2007 15:27:51 -0700, [EMAIL PROTECTED] wrote:
Consider the following:
a = {1:2, 3:4, 2:5}
Say that i want to get the keys of a, sorted. First thing I tried:
b = a.keys().sort()
print b
None
Doesn't work. Probably because I am actually trying to sort the keys
of the dictionary
On Thu, 19 Jul 2007 12:32:02 -, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I am trying to send UDP broadcast packets over a specific interface
and I
am having trouble specifying the interface:
host='192.168.28.255'
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('',0))
On Thu, 19 Jul 2007 09:25:50 -0400, Emin.shopper Martinian.shopper [EMAIL
PROTECTED] wrote:
After poking around the unittest source code, the best solution I could come
up with was to do
import unittest; unittest.TestCase.run = lambda self,*args,**kw:
unittest.TestCase.debug(self)
before running
On Tue, 17 Jul 2007 14:57:16 -0700, Walker Lindley [EMAIL PROTECTED] wrote:
I'm working on a distributed computing program and need to send Python
objects over a TCP socket. Specifically, the objects that I'm working with
subclass the builtin list type (I don't know whether or not that matters),
On Wed, 18 Jul 2007 16:40:46 -0400, Emin.shopper Martinian.shopper [EMAIL
PROTECTED] wrote:
Dear Experts,
How do you use pdb to debug when a TestCase object from the unittest module
fails? Basically, I'd like to run my unit tests and invoke pdb.pm when
something fails.
I tried the following
On Thu, 12 Jul 2007 10:33:03 -, loial [EMAIL PROTECTED] wrote:
I'ma a newbie python user and would like clarification on variable
naming conventions.
What is the difference between
self.myvariable
This is the convention for public attributes.
self._myvariable
This is the convention for
On Wed, 11 Jul 2007 03:51:27 -0700, ddtm [EMAIL PROTECTED] wrote:
I have another problem with my IRC bot. There is privmsg(self, user,
channel, msg) function (this function handles the incoming IRC data)
in the code that was mentioned above. I have a special condition in
this function that if a
On Wed, 11 Jul 2007 07:00:18 -0700, Andrew Warkentin [EMAIL PROTECTED] wrote:
On Jul 10, 8:19 pm, Steve Holden [EMAIL PROTECTED] wrote:
Bjoern Schliessmann wrote:
Andrew Warkentin wrote:
I am going to write a general-purpose modular proxy in Python. It
will consist of a simple core and
On Mon, 09 Jul 2007 13:57:02 +0100, Will McGugan [EMAIL PROTECTED] wrote:
Hi,
Is there a canonical way of storing per-thread data in Python?
See threading.local:
http://python.org/doc/lib/module-threading.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 08 Jul 2007 18:21:41 -, mshiltonj [EMAIL PROTECTED] wrote:
I'm trying to find the preferred python idiom for access arbitrary
fields of objects at run time.
It's not an idiom, it's a built-in function: getattr.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 06 Jul 2007 15:43:55 -, Robert Dailey [EMAIL PROTECTED] wrote:
Hi,
I am interested in creating an expandable (dynamic) 2D dictionary. For
example:
myvar[cat][paw] = Some String
The above example assumes myvar is declared. In order for this to
work, I have to know ahead of time the
On Thu, 05 Jul 2007 18:56:49 -, _spitFIRE [EMAIL PROTECTED] wrote:
On Jul 5, 1:34 pm, Jeff McNeil [EMAIL PROTECTED] wrote:
If you just want to send mail, you should be able to use the standard
smtplib module (http://docs.python.org/lib/module-smtplib.html). If
your recipients are on the
On Tue, 03 Jul 2007 09:46:59 -, ddtm [EMAIL PROTECTED] wrote:
I'm using an example of IRC bot (_ttp://twistedmatrix.com/projects/
words/documentation/examples/ircLogBot.py) to create my own bot. But I
have a problem. I'm trying to make my bot send messages periodically.
But I can't find a way
On Tue, 03 Jul 2007 05:12:22 -0700, Samuel [EMAIL PROTECTED] wrote:
Hi,
When using telnetlib, the connection sometimes breaks with the
following error:
error: (32, 'Broken pipe')
where the traceback points to
self.sock.send(buffer)
in telnetlib.py. The problem is unreproducible, but happens
On Tue, 03 Jul 2007 06:16:43 -0700, [EMAIL PROTECTED] wrote:
On Jul 3, 7:15 am, alf [EMAIL PROTECTED] wrote:
question without words:
r\
File stdin, line 1
r\
^
SyntaxError: EOL while scanning single-quoted string
r\
'\\ '
One slash escapes the following character, so
On Tue, 03 Jul 2007 13:44:34 -, ddtm [EMAIL PROTECTED] wrote:
On 3, 16:01, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
[snip]
Thank you very much! It's a very useful information. One more
question: can I cancel the DelayedCall using its ID (it is returned
from callLater(...)) from
On Tue, 03 Jul 2007 15:13:46 -, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
Hi
I'm considering learning Python...but with the python 3000 comming
very soon, is it worth waiting for?? I know that the old style of
coding python will run parallel with the new, but I mean, its going to
come to an
On Tue, 03 Jul 2007 15:51:30 -, ddtm [EMAIL PROTECTED] wrote:
On 3, 17:55, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
On Tue, 03 Jul 2007 13:44:34 -, ddtm [EMAIL PROTECTED] wrote:
On 3, 16:01, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
[snip]
Thank you very much! It's
On Tue, 03 Jul 2007 08:54:25 -0700, Samuel [EMAIL PROTECTED] wrote:
On Jul 3, 3:03 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
EPIPE results when writing to a socket for which writing has been shutdown.
This most commonly occurs when the socket has closed. You need to handle
On Mon, 02 Jul 2007 16:14:41 -0400, Steve Holden [EMAIL PROTECTED] wrote:
Evan Klitzke wrote:
On 7/2/07, Cathy Murphy [EMAIL PROTECTED] wrote:
Is python a compiler language or interpreted language. If it is interpreter
, then why do we have to compile it?
It's an interpreted language. It is
On Fri, 29 Jun 2007 09:56:14 -0400, Douglas Alan [EMAIL PROTECTED] wrote:
Chris Mellon [EMAIL PROTECTED] writes:
You're arguing against explicit resource management with the argument
that you don't need to manage resources. Can you not see how
ridiculously circular this is?
No. It is insane
On Thu, 28 Jun 2007 18:44:02 -0300, Bruno Barberi Gnecco [EMAIL PROTECTED]
wrote:
It seems that this question has been asked a few times in this
group before, but sometime has passed since the last post and maybe there's
something new. I'm looking for a high level IMAP library--I know of
On Tue, 26 Jun 2007 21:48:46 -0700, Adam Atlas [EMAIL PROTECTED] wrote:
Does anyone have a copy of PyKQueue 2.0 around? The site it's supposed
to be on (http://python-hpio.net/trac/wiki/PyKQueue) is down.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 26 Jun 2007 22:37:16 +0200, Laszlo Nagy [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
I am writing a curses application, but the getch() does not seem to
give me all I want. Of course, if I press d, it returns an ord(d)
and so on. But I want to be able to detect whether alt, shift
On Sun, 24 Jun 2007 11:17:40 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote:
On Sat, 23 Jun 2007 19:58:32 +, vasudevram wrote:
Hi group,
Question: Do eval() and exec not accept a function definition? (like
'def foo: pass) ?
eval() is a function, and it only evaluates EXPRESSIONS, not
On Thu, 21 Jun 2007 06:51:17 -0700, JonathanB [EMAIL PROTECTED] wrote:
I have a multi-access problem that I'm pretty sure needs to be solved
with threading, but I'm not sure how to do it. This will be my first
foray into threading, so I'm a little confused by all of the new
landscape. So, I'm
On Thu, 21 Jun 2007 08:03:22 -0700, JonathanB [EMAIL PROTECTED] wrote:
You described how threads introduce a problem in your program -- that of
generating a sequence of sequential identifiers -- but you didn't describe
the problem that threads are solving in your program. Maybe you don't
On Sun, 17 Jun 2007 08:15:46 -0700, Roy Smith [EMAIL PROTECTED] wrote:
I'm starting a new project and am thinking of embedding my unit tests
right in the source files. I've used unittest before, and I'm happy
with it, but I've always used it with the source code in one file and
the unit tests in
On Mon, 11 Jun 2007 04:56:43 -0700, geoffbache [EMAIL PROTECTED] wrote:
Twisted *should* be able to do this, as it uses non-blocking IO.
http://twistedmatrix.com/trac/
Thanks for the tip. I'll take a look if nobody has any better
suggestions.
Twisted is a pretty good suggestion in general.
On Mon, 11 Jun 2007 16:54:10 -0700, James Stroud [EMAIL PROTECTED] wrote:
Beorn wrote:
Consider this example:
def funcs(x):
... for i in range(5):
... def g(): return x + i
... yield g
[snip]
If this isn't classified as a bug, then someone has some serious
On Sat, 9 Jun 2007 13:52:19 -0700, Warren Stringer [EMAIL PROTECTED] wrote:
Am still trying to hook a NameError exception and continue to run. After a
few more hours of searching the web and pouring over Martelli's book, the
closest I've come is:
import sys
def new_exit(arg=0):
... print
On Sat, 9 Jun 2007 05:58:41 +1000 (EST), Mr SZ [EMAIL PROTECTED] wrote:
I'm using tls lite to send mail using gmail's smtp.This is what I've done:
from tlslite.api import *
import tlslite.integration.SMTP_TLS
connection= tlslite.integration.SMTP_TLS.SMTP_TLS('smtp.gmail.com',587)
On Fri, 08 Jun 2007 15:36:30 -0700, mike [EMAIL PROTECTED] wrote:
I have called the setsockopt() to set no delay after connecting like
this way:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.10.1', 21980))
s.setsockopt(socket.SOL_TCP,
On Thu, 31 May 2007 14:07:00 -0400, Christopher Stawarz [EMAIL PROTECTED]
wrote:
Does anyone know of a standalone module for parsing and generating
HTTP messages? I'm looking for something that will take a string and
return a convenient message object, and vice versa. All the Python
HTTP
On 21 May 2007 05:10:46 -0700, mosscliffe [EMAIL PROTECTED] wrote:
I keep seeing examples of statements where it seems conditionals are
appended to a for statement, but I do not understand them.
I would like to use one in the following scenario.
I have a dictionary of
mydict = { 1: 500, 2:700,
On 21 May 2007 06:17:16 -0700, dmitrey [EMAIL PROTECTED] wrote:
howto check does module 'asdf' exist (is available for import) or no?
(without try/cache of course)
Thx in advance, D.
You could use twisted.python.modules:
$ python
Python 2.4.3 (#2, Oct 6 2006, 07:52:30)
[GCC 4.0.3
On Tue, 15 May 2007 13:23:29 -0600, Jeffrey Barish [EMAIL PROTECTED] wrote:
I have a class derived from string that is used in a pickle. In the new
version of my program, I moved the module containing the definition of the
class. Now the unpickle fails because it doesn't find the module. I was
On 10 May 2007 05:45:24 -0700, [EMAIL PROTECTED] wrote:
Hi,
please consider the following code:
from __future__ import with_statement
class safe_dict(dict):
def __init__(self, *args, **kw):
self.lock = threading.Lock()
dict.__init__(self, *args, **kw)
def
On 8 May 2007 06:59:26 -0700, [EMAIL PROTECTED] wrote:
Hi,
I'm trying to create a tcp/ip port listening socket server for various
cellular devices that don't use the standard \r\n termination string
at the end of their message. Instead, they use -ND-. Do you know
how I can setup such a server,
On Sat, 5 May 2007 15:37:31 +0300, Maxim Veksler [EMAIL PROTECTED] wrote:
On 5/4/07, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
#!/usr/bin/env python
import socket
import select
class PollingSocket(socket.socket):
Usually there's no particularly good reason to subclass socket
On Fri, 4 May 2007 15:05:46 +0300, Maxim Veksler [EMAIL PROTECTED] wrote:
On 5/4/07, Maxim Veksler [EMAIL PROTECTED] wrote:
On 5/4/07, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
On Fri, 4 May 2007 13:04:41 +0300, Maxim Veksler [EMAIL PROTECTED]
wrote:
Hi,
I'm trying to write a non
On Fri, 4 May 2007 13:04:41 +0300, Maxim Veksler [EMAIL PROTECTED] wrote:
Hi,
I'm trying to write a non blocking socket port listener based on
poll() because select is limited to 1024 fd.
Here is the code, it never gets to I did not block until I do a
telnet connection to port 1.
What were
On 3 May 2007 04:30:37 -0700, [EMAIL PROTECTED] wrote:
On 2 May, 17:29, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] wrote:
The code:
import codecs
udlASCII = file(c:\\temp\\CSVDB.udl,'r')
udlUNI = codecs.open(c:\\temp\\CSVDB2.udl,'w
On 3 May 2007 12:13:49 GMT, Duncan Booth [EMAIL PROTECTED] wrote:
sturlamolden [EMAIL PROTECTED] wrote:
I am curious to know how it performs in comparison to CPython and an
efficient compiled Lisp like CMUCL. Speed is a major problem with
CPython but not with .NET or CMUCL, so it will be
On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] wrote:
The code:
import codecs
udlASCII = file(c:\\temp\\CSVDB.udl,'r')
udlUNI = codecs.open(c:\\temp\\CSVDB2.udl,'w',utf_16)
udlUNI.write(udlASCII.read())
udlUNI.close()
udlASCII.close()
This doesn't seem to generate the correct line endings.
On Wed, 02 May 2007 13:05:08 -0700, Tobiah [EMAIL PROTECTED] wrote:
In addition to the above good advice, in case you are submitting a query
to a DB-API compliant SQL database, you should use query parameters
instead of building the query with string substitution.
I tried that a long time
On 26 Apr 2007 20:05:45 +0200, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-04-26, Steven Howe [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Well, why do some things in the library have to be functions,
and other things have to be class methods?
Perhaps because some things are more
701 - 800 of 1065 matches
Mail list logo