Andrew Berg wrote:
> […]
As for your question in the Subject, I do not know since I am reading the
newsgroup.
Therefore, however, I can tell you that the mailing list to Usenet gateway
is seriously borked, as missing References header fields are not generated
by the gateway. As a result, the
Ian Kelly wrote:
@enclose
def test5(string, func):
print(func(string))
test5('broken', func=str.upper)
Yes, that is a limitation -- one loses the func keyword for the
decorated function. If I were to actually use this, I'd probably go
with '_func' as the keyword.
~Ethan~
PS
Thanks f
Robert Upton wrote:
> I am in the process of generating a simple GUI that wants to read a
> string and print it to the terminal after engaging a button. I am
> running into a problem where Python says it does not understand the
> get() attribute for Entry.
Please don't paraphrase Python's erro
On Wed, Jun 29, 2011 at 3:29 PM, Ethan Furman wrote:
> 8<
> class enclose(object):
> func = None
> def __init__(self, char='#'):
> self.char = char
> if callable(char): # was a function passed in directly?
>
- Original Message -
From: "Andrew Berg"
To: "comp.lang.python"
Sent: Wednesday, June 29, 2011 1:34 PM
Subject: Is the Usenet to mailing list gateway borked?
I didn't get at least two messages from the "call a function every 10
seconds thread", and possibly some other messages, and
Ian Kelly wrote:
On Wed, Jun 29, 2011 at 1:30 PM, Ethan Furman wrote:
How about just having one bit of code that works either way?
How would you adapt that code if you wanted to be able to decorate a
function that takes arguments?
8<--
I forgot to mention I don't have Usenet access, and Google Groups'
archives don't have messages from the last couple of days, so I can't
check the Usenet side.
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.06.29 03:53 PM, Noah Hall wrote:
> I think the more likely answer is that it was sent without being also
> sent to python-list.
Possible, but they were two messages from two different people and
happened within a few hours of each other, so it could be that the two
messages didn't go throug
On Wed, Jun 29, 2011 at 9:34 PM, Andrew Berg wrote:
> I didn't get at least two messages from the "call a function every 10
> seconds thread", and possibly some other messages, and I access the
> group via the mailing list. I use the latest stable Thunderbird, if that
> matters. I've only noticed
In article <4e0b6383$0$29996$c3e8da3$54964...@news.astraweb.com>
wrote:
>I have a script running under Python 2.5 that needs to modify files in
>place. I want to do this with some level of assurance that I won't lose
>data. ... I have come up with this approach:
[create temp file in suitable dir
I didn't get at least two messages from the "call a function every 10
seconds thread", and possibly some other messages, and I access the
group via the mailing list. I use the latest stable Thunderbird, if that
matters. I've only noticed this recently, and I'm still getting other
messages. In fact,
am new to the list and kinda new to python too
would like to meet fellow developers who work on google docs API and app engine
am developing an app for that will add extra security layer to google docs
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jun 29, 2011 at 1:30 PM, Ethan Furman wrote:
> How about just having one bit of code that works either way?
How would you adapt that code if you wanted to be able to decorate a
function that takes arguments?
This also won't work if the argument to the decorator is itself a
callable, such
Dear Pythoners,
I am in the process of generating a simple GUI that wants to read a
string and print it to the terminal after engaging a button. I am
running into a problem where Python says it does not understand the
get() attribute for Entry. My code is very simple and is shown
below. Please
John Posner wrote:
Investigating how this fact fit in with the current thread, I came up
with an alternative to the three levels of "def" (pronounced "three
levels of death"). Following is code for two decorators:
* the first one encloses the output of a function with lines of "#"
characters, an
On 2011-06-29, steve+comp.lang.pyt...@pearwood.info
wrote:
> I have a script running under Python 2.5 that needs to modify files in
> place. I want to do this with some level of assurance that I won't lose
> data. E.g. this is not safe:
>
> def unsafe_modify(filename):
> fp = open(filename, '
Christopher Barrington-Leigh wrote:
> I'd like to have the Sample A box place itself
> in the optimal empty space, so as not to overlay
> any graphing elements (if possible):
>
A simple alternative might be to place the label
just outside of the plot region either at the top
or the
Yeah it won't work. Recursion depth will be reached. Steven's suggestion is
much better.
--
Max Countryman
+1-917-971-8472
On Wednesday, June 29, 2011 at 2:05 PM, santosh h s wrote:
> how to end ths over a period of time
>
> On Wed, Jun 29, 2011 at 11:25 PM, Max Countryman (mailto:m...@me.c
On 2:59 PM, Lie Ryan wrote:
>> Can any of you guys explain me advantages and disadvantages of
>> using each of them
> Simplicity is one, using @decor() means you have at least three-level
> nested functions, which means the code is likely to be very huge and
> perhaps unnecessarily.
Bruce Eckel po
hisan wrote:
> Hi All,
> I need to call a function for evry 10 secs
> how can i achieve this in python
import time
while True:
time.sleep(10)
function()
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
I have a script running under Python 2.5 that needs to modify files in
place. I want to do this with some level of assurance that I won't lose
data. E.g. this is not safe:
def unsafe_modify(filename):
fp = open(filename, 'r')
data = modify(fp.read())
fp.close()
fp = open(filename,
Hi All,
I need to call a function for evry 10 secs
how can i achieve this in python
--
http://mail.python.org/mailman/listinfo/python-list
Ulrich Eckhardt wrote:
> Peter Otten wrote:
>> Examples for classes that don't accept attributes are builtins
>> like int, tuple, and -- obviously -- dict. You can make your own
>> using the __slot__ mechanism:
>>
> class A(object):
>> ... __slots__ = ["x", "y"]
>> ...
> a = A()
>
Ulrich Eckhardt wrote:
> Peter Otten wrote:
>> Examples for classes that don't accept attributes are builtins
>> like int, tuple, and -- obviously -- dict. You can make your own
>> using the __slot__ mechanism:
>>
> class A(object):
>> ... __slots__ = ["x", "y"]
>> ...
> a = A()
>
I still need help with this.
I'd like to have the Sample A box place itself in the optimal empty space, so
as not to overly any graphing elements (if possible):
import numpy.random
import matplotlib.pyplot as plt
fig = plt.figure(1, figsize=(5,5))
fig.clf()
ax = fig.add_subplot(111)
ax.set_a
Am 29.06.2011 16:58, schrieb Ulrich Eckhardt:
> Now, follow-up question:
> 1. The slots are initialized to None, right? Or are they just reserved? IOW,
> would "print a.x" right after creation of the object print anything or raise
> an AttributeError?
No, slots don't have a default value. It wou
Peter Otten wrote:
> Examples for classes that don't accept attributes are builtins
> like int, tuple, and -- obviously -- dict. You can make your own
> using the __slot__ mechanism:
>
class A(object):
> ... __slots__ = ["x", "y"]
> ...
a = A()
a.x = 42
a.y = "yadda"
a
Hi Everyone,
I am having an issue with getting python-ldap to compile in my RHEL
enviroment. I am running python 2.7.2 from source, and I have the
openldap-devel package installed but still can not get this to work.
Here is the output:
extra_compile_args: -g
extra_objects:
include_dirs: /opt/op
AlienBaby wrote:
> I'm just wondering why something is so, and whats going on under the
> hood.
>
> Now and again I use something like
>
> class empty(object):
> pass
>
>
> simply so I can make an instance, and set some attributes on it.
>
> a=empty()
> a.whatever=something
>
>
> Poking ar
Hi,
I'm just wondering why something is so, and whats going on under the
hood.
Now and again I use something like
class empty(object):
pass
simply so I can make an instance, and set some attributes on it.
a=empty()
a.whatever=something
Poking around with this, I assumed I could instead say
okie i agree with your comment, if the case is simple we would
prefer not to make it complex but if required there would be nor harm in
using decorators with Arguments
Thanks,
J
--- On Tue, 28/6/11, Lie Ryan wrote:
From: Lie Ryan
Subject: Re: Using decorators with argument in Pyt
Hi there,
after switching from Ubuntu to Arch Linux I noticed a disturbing problem
in a Python script I wrote (see
http://sourceforge.net/projects/emcdutilityprog/files/).
Using Windows (Python 2.6) and Ubuntu 11.04 (Python 2.7) I did not
experience any problems.
Using Arch Linux (Python 2.7) I got
yes for this case you will have to use @memoize() as all the arguments are
optional ...
Thanks,
J
--- On Tue, 28/6/11, Ian Kelly wrote:
From: Ian Kelly
Subject: Re: Using decorators with argument in Python
To: "Jigar Tanna"
Cc: python-list@python.org
Date: Tuesday, 28 June, 2011, 10:50 PM
Hope you find the following as amusing as I did -
http://www.davidnaylor.co.uk/eu-cookies-directive-interactive-guide-to-25th-may-and-what-it-means-for-you.html
Background -
On 26 May new legislation came into force in the UK regulating how web sites
use cookies. It is the outcome of amendment
Amaninder Singh wrote:
> I am fairly new to the language and programing. I am trying to solve a
> problem in a text file. Where names are something like in this manner
> [**Name2 (NI) 98**]
>
> [**Last Name (STitle) 97**]
> [**First Name4 (NamePattern1) 93**]
> [**Last Name (NamePattern1) 94**]
35 matches
Mail list logo