En Tue, 22 Jun 2010 14:18:59 -0300, Terry Reedy
escribió:
On 6/22/2010 5:44 AM, Daniel Fetchinson wrote:
how can i simply add new functions to module after its initialization
(Py_InitModule())? I'm missing something like
PyModule_AddCFunction().
in Python, for modules written in python
imp
On 6/22/10 9:45 PM, John Bokma wrote:
> Stephen Hansen writes:
>
>> I *have* seen people burned by confusion over situations *extremely*
>> similar to this;
>
> But is it? You didn't even ask yourself that question.
Yes. I did.
I don't really make a point of publishing internal dialog on maili
En Tue, 22 Jun 2010 11:02:58 -0300, escribió:
Python 2.6.4 (Win32): Anyone have any explanation for the
following
encodings.idna.ToASCII( unicodeStr ) != unicodeStr.encode( 'idna'
)
Given that other processes may have to use the output of these
methods, what is the recommended technique?
Dem
Am 22.06.2010 19:18, schrieb Terry Reedy:
> On 6/22/2010 5:44 AM, Daniel Fetchinson wrote:
>>> how can i simply add new functions to module after its initialization
>>> (Py_InitModule())? I'm missing something like
>>> PyModule_AddCFunction().
>
> in Python, for modules written in python
>
> imp
rantingrick wrote:
---
On Jun 22, 4:29 am, Jean-Michel Pichavant
wrote:
This is a python list, fully dedicated to our dutch semi God. So how can
you even immagine that someone here will suggest you to go for rub...
sorry I can't prononce this blasphemous name.
---
...After reading
On 06/23/2010 08:39 AM, Satish Eerpini wrote:
>
>
> I want to test whether an object is an instance of any
> user-defined
> class. "isinstance" is less helpful than one would expect.
>
> >>> import types
> >>> class foo() : # define dummy class
>
I am looking for a simple multi threaded example.
Lets say I have to ssh to 20 servers and I would like to that in
parallel. Can someone please provide a an example for that?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Ruby is a nice language to learn, but I seem to find it less matured.
That might be my own personal perception.
But looking at its success which you can read on Pythonology, I think it
is going to be my choice and of many others for a long time to come.
Besides ruby is more popular due to the r
Mag Gam, 23.06.2010 12:24:
I am looking for a simple multi threaded example.
Lets say I have to ssh to 20 servers and I would like to that in
parallel. Can someone please provide a an example for that?
Sounds like you want to run background processes, not threads. Take a look
at the subproce
Hi,
I've written a decorator that prints exceptions and I'm having some
trouble with garbage collection.
My decorator is:
import sys
def print_exception_decorator(fn):
def decorator(self, *args, **kwds):
try:
return fn(*args, **kwds)
except:
print '
On 06/23/2010 01:40 PM, John Reid wrote:
> Hi,
>
> I've written a decorator that prints exceptions and I'm having some
> trouble with garbage collection.
>
> My decorator is:
>
> import sys
> def print_exception_decorator(fn):
> def decorator(self, *args, **kwds):
> try:
>
John Reid wrote:
> Hi,
>
> I've written a decorator that prints exceptions and I'm having some
> trouble with garbage collection.
>
> My decorator is:
>
> import sys
> def print_exception_decorator(fn):
> def decorator(self, *args, **kwds):
> try:
> return fn(*args, *
> The InstanceCounted.count is 1 at the end. If I omit the call to
> "self.method = print_exception_decorator(self.method)" then the instance
> count goes down to 0 as desired. I thought that the decorator might be
> holding a reference to the instance through the bound method, so I added
> t
Thomas Jollans wrote:
The InstanceCounted.count is 1 at the end. If I omit the call to
"self.method = print_exception_decorator(self.method)" then the instance
count goes down to 0 as desired. I thought that the decorator might be
holding a reference to the instance through the bound method, so
--- On Wed, 6/23/10, Stephen Hansen wrote:
> From: Stephen Hansen
> Subject: Re: Should I Learn Python or Ruby next?
> To: python-list@python.org
> Date: Wednesday, June 23, 2010, 1:51 AM
> On 6/22/10 10:39 PM, Dennis Lee
> Bieber wrote:
> > On Tue, 22 Jun 2010 15:55:51 -0700, Stephen Hansen
> >
--- On Wed, 6/23/10, Dennis Lee Bieber wrote:
> From: Dennis Lee Bieber
> Subject: Re: Should I Learn Python or Ruby next?
> To: python-list@python.org
> Date: Wednesday, June 23, 2010, 1:39 AM
> On Tue, 22 Jun 2010 15:55:51 -0700,
> Stephen Hansen
>
> declaimed the following in
> gmane.comp.p
Hi;
I have this line:
cursor.execute('select clientEmail from clients where client=%s',
(string.replace(client, '_', ' ')))
clientEmail = cursor.fetchone()[0]
cursor.execute('select * from %s' % (client))
client = "Lincoln_Properties"
With the replacement, the interpreter complains that myd
Stephen Hansen wrote:
On 6/22/10 10:39 PM, Dennis Lee Bieber wrote:
On Tue, 22 Jun 2010 15:55:51 -0700, Stephen Hansen
declaimed the following in
gmane.comp.python.general:
I second Forth. Learning and using that was -- slightly painful, but
Just pick up any advanced H
On 6/23/10 6:45 AM, Victor Subervi wrote:
> Hi;
> I have this line:
>
> cursor.execute('select clientEmail from clients where client=%s',
> (string.replace(client, '_', ' ')))
> clientEmail = cursor.fetchone()[0]
> cursor.execute('select * from %s' % (client))
>
> client = "Lincoln_Properti
Hi guys,
I use these codes to read emails from an IMAP server:
import imaplib
imap_srv_addr = "someserver"
imap_srv = imaplib.IMAP4_SSL(imap_srv_addr)
imap_srv.login("username","passwd")
imap_srv.select("Inbox")
msg = imap_srv.fetch(1, '(RFC822)')
How can I parse msg so it can be appended to th
On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen
wrote:
> On 6/23/10 6:45 AM, Victor Subervi wrote:
> > Hi;
> > I have this line:
> >
> > cursor.execute('select clientEmail from clients where client=%s',
> > (string.replace(client, '_', ' ')))
> > clientEmail = cursor.fetchone()[0]
> > curso
On 6/23/10 8:16 AM, Victor Subervi wrote:
> On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen
> mailto:pyt...@ixokai.io>> wrote:
>
> On 6/23/10 6:45 AM, Victor Subervi wrote:
> > Hi;
> > I have this line:
> >
> > cursor.execute('select clientEmail from clients where client=%s'
On Wed, 23 Jun 2010 10:46:37 -0430, Victor Subervi
wrote:
> On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen
> wrote:
>
>> On 6/23/10 6:45 AM, Victor Subervi wrote:
>> > Hi;
>> > I have this line:
>> >
>> > cursor.execute('select clientEmail from clients where client=%s',
>> > (string.replace(c
'_sre.SRE_Pattern' is what "re.compile" returns.
Is that a mutable object, with state that changes
during the parse, or is it an immutable constant? Can
two threads use the same '_sre.SRE_Pattern' at the same time?
(I'm writing something to find race conditions in existing code,
which
Stephen Hansen writes:
>On 6/23/10 6:45 AM, Victor Subervi wrote:
>> cursor.execute('select clientEmail from clients where client=%s', ...
> Do, 'client.replace("_", " ")' instead.
Er, look what happened to Little Bobby Tables (a quick web search on his
name should find his story) because someo
On Wed, 23 Jun 2010 10:46:37 -0430, Victor Subervi
wrote:
> On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen
> wrote:
>
>> On 6/23/10 6:45 AM, Victor Subervi wrote:
>> > Hi;
>> > I have this line:
>> >
>> > cursor.execute('select clientEmail from clients where client=%s',
>> > (string.replace(c
On 06/23/2010 08:45 AM, Victor Subervi wrote:
Hi;
I have this line:
cursor.execute('select clientEmail from clients where client=%s',
(string.replace(client, '_', ' ')))
clientEmail = cursor.fetchone()[0]
cursor.execute('select * from %s' % (client))
client = "Lincoln_Properties"
With
Ok, let's start all over again. When I have this code:
cursor.execute('select clientEmail from clients where client="%s"',
(client.replace('_', ' '),))
clientEmail = cursor.fetchone()[0]
I get this error:
/var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py
67
68 '''
69
70
The new mision I herits the buggered code (i do not the bugger). How
do debugger him? Tahnk you very much. Vikhy :)
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 23, 2010, at 9:12 AM, Paul Rubin wrote:
Stephen Hansen writes:
On 6/23/10 6:45 AM, Victor Subervi wrote:
cursor.execute('select clientEmail from clients where client=%s', ...
Do, 'client.replace("_", " ")' instead.
Er, look what happened to Little Bobby Tables (a quick web search on
On Jun 23, 2010, at 9:28 AM, Victor Subervi wrote:
Ok, let's start all over again. When I have this code:
cursor.execute('select clientEmail from clients where client="%s"',
(client.replace('_', ' '),))
clientEmail = cursor.fetchone()[0]
Already addressed this. Do not quote inside the SQL.
Stephen Hansen writes:
> On 6/22/10 9:48 PM, John Bokma wrote:
[..]
> Its when you package it up in such a way that the buyer doesn't realize
> what they're buying, that's where the problem comes-- and that's what is
> happening quite a lot these days.
Which is not the case here.
> If it look
On Jun 23, 2010, at 9:10 AM, John Nagle wrote:
> '_sre.SRE_Pattern' is what "re.compile" returns.
>
> Is that a mutable object, with state that changes
> during the parse, or is it an immutable constant? Can
> two threads use the same '_sre.SRE_Pattern' at the same time?
Ouch. I hope it is
Tkinter's Scale widget had a `label` and a `resolution` attribute.
These appear to be missing from the Ttk Scale widget.
Is there a reason? These were important attributes.
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle wrote:
'_sre.SRE_Pattern' is what "re.compile" returns.
Is that a mutable object, with state that changes
during the parse, or is it an immutable constant? Can
two threads use the same '_sre.SRE_Pattern' at the same time?
(I'm writing something to find race conditions in ex
On 06/23/2010 02:56 PM, John Reid wrote:
>
>
> Thomas Jollans wrote:
>>> The InstanceCounted.count is 1 at the end. If I omit the call to
>>> "self.method = print_exception_decorator(self.method)" then the instance
>>> count goes down to 0 as desired. I thought that the decorator might be
>>> hol
On Wed, Jun 23, 2010 at 12:51 PM, Stephen Hansen wrote:
> The problem is not this line but:
>
>
> File "/var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py", line
> 38, in mailSpreadsheet
> cursor.execute('select * from %s', (client,))
>
>
> This one.
>
Yes, can't use the comma, must
On Jun 23, 2010, at 11:20 AM, Victor Subervi
wrote:
On Wed, Jun 23, 2010 at 12:51 PM, Stephen Hansen wrote:
> The problem is not this line but:
>
>
> File "/var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py", line
> 38, in mailSpreadsheet
> cursor.execute('select * from %s', (client
On 6/23/2010 1:39 AM, Dennis Lee Bieber wrote:
On Tue, 22 Jun 2010 15:55:51 -0700, Stephen Hansen
declaimed the following in
gmane.comp.python.general:
I second Forth. Learning and using that was -- slightly painful, but
Just pick up any advanced HP programmable calculator... RPL is
FASCINATING !!!
An ECOLOGICAL DISASTER is taking place.
There is a need for HERCULEAN effort to STOP the oil spill.
Then there is need for a THOROUGH study of the incident and EXEMPLARY
PUNISHMENT of ALL THE OIL COMPANY BASTARDS, Brits, Halliburtons and
ALL of them.
But the JUDGE is worried about h
On Wed, 23 Jun 2010 04:25:38 +0100, rantingrick
wrote:
On Jun 22, 9:31 pm, MRAB wrote:
[snip]
Napoleon once said "Never interrupt your enemy when he is making a
mistake."! :-)
And how exactly does your example express itself in a more
"syntactically-correct" "linear-flow" than the two co
Dear Pythoners,
I need to send one line of commands to an IMAP server. The commands
are not standard IMAP protocols, hence it's not specified in
http://docs.python.org/library/imaplib.html. Can you please give me a
hint?
Best regards,
Xianwen
--
http://mail.python.org/mailman/listinfo/python-li
Given a program 'foo' that takes a command line argument '-I
includefile', I want to be able to look for 'includefile' in a path
specified in an environment variable, 'FOOPATH'.
I'd like a semantic that says:
"If 'includefile' contains one or more path separator characters,
ignore 'FOOPATH'.
On Jun 23, 4:43 pm, "Rhodri James"
wrote:
> > And how exactly does your example express itself in a more
> > "syntactically-correct" "linear-flow" than the two code snippets i
> > provided earlier, hmmm?
>
> You did rather carefully pick an example where Python's syntax flow the
> other way rou
> Would you like to present another way of achieving the same code that
> makes Python look better, i would love to see it. Here is an even more
> interesting example of "Ruby linear-flow" verses "Python lisp-style-
> nesting"...
>
> RUBY:
> ["three","one","two"].map{|x| x.capitalize}.sort.join(','
On 06/23/2010 05:22 PM, Xianwen Chen wrote:
I need to send one line of commands to an IMAP server. The commands
are not standard IMAP protocols, hence it's not specified in
http://docs.python.org/library/imaplib.html.
Sounds like you want to use the imaplib's IMAP4.xatom() to send a
custom com
Hi all,
I'd like to ask about the most reasonable/recommended/... way to
modify the functionality of the standard library module (if it is
recommended at all).
I'm using difflib.SequenceMatcher for character-wise comparisons of
the texts; although this might not be a usual use case, the results
are
On Wed, Jun 23, 2010 at 3:27 PM, Tim Daneliuk wrote:
> Given a program 'foo' that takes a command line argument '-I
> includefile', I want to be able to look for 'includefile' in a path
> specified in an environment variable, 'FOOPATH'.
>
> I'd like a semantic that says:
>
> "If 'includefile' con
Hello all,
I'm happy to announce the initial release of filepath.
filepath is an abstract interface to the filesystem. It provides APIs
for path name manipulation and for inspecting and modifying the
filesystem (for example, renaming files, reading from them, etc).
filepath's APIs are intend
On Jun 23, 2:02 pm, nanothermite911fbibustards
wrote:
> FASCINATING !!!
> An ECOLOGICAL DISASTER is taking place.
> There is a need for HERCULEAN effort to STOP the oil spill.
> Then there is need for a THOROUGH study of the incident and EXEMPLARY
> PUNISHMENT of ALL THE OIL COMPANY BASTARDS, Brit
On Tue, Jun 22, 2010 at 12:13 PM, Stephen Hansen
wrote:
> On 6/22/10 9:44 AM, Peng Yu wrote:
>> Also, always importing the inspect module and getting the frame and
>> accessing the lineno from the frame is not very convenient to type. Is
>> there a shorter way to access the line number (for exampl
On Wed, 23 Jun 2010 19:10:45 -0700 (PDT), MooseFET wrote:
>On Jun 23, 2:02 pm, nanothermite911fbibustards
> wrote:
>> FASCINATING !!!
>> An ECOLOGICAL DISASTER is taking place.
>> There is a need for HERCULEAN effort to STOP the oil spill.
>> Then there is need for a THOROUGH study of the inciden
Many library modules support "python setup.py test", but the
Python distutils documentation at
http://docs.python.org/distutils/configfile.html
makes no mention of it, except as a possible future extension.
Some setup.py files have
test_suite = "modulename"
but that does
Here's dir(types), in Python 2.6.5:
['BooleanType', 'BufferType', 'BuiltinFunctionType',
'BuiltinMethodType', 'ClassType', 'CodeType', 'ComplexType',
'DictProxyType', 'DictType', 'DictionaryType', 'EllipsisType',
'FileType', 'FloatType', 'FrameType', 'FunctionType', 'GeneratorType',
'GetSet
Of course one can do
myintvar.set(myintvar.get()+1)
but surely there is a better way?
I'm surprsied that
myintvar += 1
is not allowed.
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Sent from my iPad
On Jun 23, 2010, at 9:24 PM, John Nagle wrote:
> Here's dir(types), in Python 2.6.5:
>
> ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType',
> 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType',
> 'DictionaryType', 'EllipsisType', 'File
On Jun 23, 2010, at 9:24 PM, John Nagle wrote:
> Here's dir(types), in Python 2.6.5:
>
> ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType',
> 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType',
> 'DictionaryType', 'EllipsisType', 'FileType', 'FloatType',
Alan G Isaac writes:
> Of course one can do
> myintvar.set(myintvar.get()+1)
> but surely there is a better way?
What is an IntVar? It's not a built-in type, so you'll need to tell us.
type(myintvar)
Where is it imported from?
import sys
sys.modules[type(myintvar).__module__
On Jun 24, 12:07 am, Ben Finney wrote:
> Alan G Isaac writes:
>
> > Of course one can do
> > myintvar.set(myintvar.get()+1)
> > but surely there is a better way?
>
> What is an IntVar? It's not a built-in type, so you'll need to tell us.
For those who don't know; IntVar is from the module Tki
On 6/23/2010 10:59 PM, Dennis Lee Bieber wrote:
On Wed, 23 Jun 2010 11:58:24 -0430, Victor Subervi
declaimed the following in
gmane.comp.python.general:
When I have this code:
And yes -- it IS an error... You are AGAIN trying to use parameters
for SCHEMA entities, not data.
On 6/23/2010 10:08 PM, Stephen Hansen wrote:
On Jun 23, 2010, at 9:24 PM, John Nagle wrote:
Here's dir(types), in Python 2.6.5:
['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType',
'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType',
'DictionaryType',
On Thu, Jun 24, 2010 at 12:29 AM, John Nagle wrote:
> Does the "types" module go away in 3.x, then?
Not entirely, but it is greatly reduced.
--
http://mail.python.org/mailman/listinfo/python-list
62 matches
Mail list logo