Terry Reedy, 14.12.2011 06:01:
On 12/13/2011 6:21 PM, Ethan Furman wrote:
In the near future I will need to parse and rewrite parts of a xml files
created by a third-party program (PrintShopMail, for the curious).
It contains both binary and textual data.
There has been some strong debate about
On 12/14/2011 1:05 AM, Eric Snow wrote:
On Tue, Dec 13, 2011 at 10:42 PM, Steve Howell wrote:
I'm using Python 3.2.2, and the following program gives me an error
that I don't understand:
class Foo:
pass
foo = Foo()
foo.name = "Steve"
def add_goodbye_function(obj):
def goodbye():
prin
On Tue, Dec 13, 2011 at 10:42 PM, Steve Howell wrote:
> I'm using Python 3.2.2, and the following program gives me an error
> that I don't understand:
>
> class Foo:
> pass
>
> foo = Foo()
> foo.name = "Steve"
>
> def add_goodbye_function(obj):
> def goodbye():
> print("goodbye " + obj.name)
I'm using Python 3.2.2, and the following program gives me an error
that I don't understand:
class Foo:
pass
foo = Foo()
foo.name = "Steve"
def add_goodbye_function(obj):
def goodbye():
print("goodbye " + obj.name)
obj.goodbye = goodbye
add_goodbye_function(foo)
foo.goodbye() # output
On 12/13/2011 6:21 PM, Ethan Furman wrote:
In the near future I will need to parse and rewrite parts of a xml files
created by a third-party program (PrintShopMail, for the curious).
It contains both binary and textual data.
There has been some strong debate about the merits of minidom vs
Elemen
On Mon, 12 Dec 2011 09:29:11 -0800, Eelco wrote:
[quoting Jussi Piitulainen ]
>> They recognize modular arithmetic but for some reason insist that there
>> is no such _binary operation_. But as I said, I don't understand their
>> concern. (Except the related concern about some programming language
Le 13/12/11 20:46, Richard a écrit :
Hi,
We are making a screen with data driven buttons. I can add buttons but
can't redraw the buttons for new values. The buttuns are placed in a
frame.
I draw the buttons on the screen in a for loop:
def drawS1Butons(self):
n=
On Tue, 13 Dec 2011 16:24:05 +, Andrea Crotti wrote:
> I'm not sure for how long I had this bug, and I could not understand the
> problem.
>
> I had a function which would return a boolean
>
> def func_bool():
> if x:
> return True
> else: return False
x is a global? Poor
In the near future I will need to parse and rewrite parts of a xml files
created by a third-party program (PrintShopMail, for the curious).
It contains both binary and textual data.
There has been some strong debate about the merits of minidom vs
ElementTree.
Recommendations?
~Ethan~
--
http:
On 13/12/2011 16:50, Sagy Drucker wrote:
hello
Hi
i am relatively new to python, so please be considerate...
As I am only responding to one of your questions, perhaps it would be
best if you don't get any other more helpful replies to split your
questions up and post them separately.
i'm im
On 12/13/2011 9:21 AM, Andrea Crotti wrote:
Another possible option is to just add to the path everything contained
in that
correct easy_install.pth file.
Or is there a way to reload the path settings?
If you are talking about sys.path, you can certainly copy, mutate or
replace, and restore s
On Dec 13, 1:21 pm, Stefan Behnel wrote:
> ru...@yahoo.com, 13.12.2011 20:37:
>
> > On Dec 13, 5:32 am, Stefan Behnel wrote:
> >> In Python 2.7/3.2, ElementTree has support for C14N serialisation, just
> >> pass the option method="c14n".
>
> > Where does one find information in the Python document
On Dec 13, 7:15 pm, Ian Kelly wrote:
> On Tue, Dec 13, 2011 at 1:44 AM, Eelco wrote:
> > 'for i in llist' is not quite going to fly is it? Thats probably the
> > reason noone ever uses that construct; its not a proper sequence type.
>
> Not really a problem, because fortunately Python makes it su
On 13 December 2011 19:54, Ian Kelly wrote:
> On Tue, Dec 13, 2011 at 12:43 PM, Joshua Landau
> wrote:
> > On 13 December 2011 19:34, Ian Kelly wrote:
> >>
> >> On Tue, Dec 13, 2011 at 1:34 AM, Joshua Landau
> >> wrote:
> >> >> No, there is another difference, the reason for rebinding the name
On Dec 13, 8:11 pm, Cameron Simpson wrote:
> On 13Dec2011 00:30, Eelco wrote:
> | On Dec 13, 1:27 am, alex23 wrote:
> | > On Dec 13, 3:12 am, Eelco wrote:
> | > > But to relate it to the topic of this thread: no, the syntax does not
> | > > allow one to select the type of the resulting sequence
ru...@yahoo.com, 13.12.2011 20:37:
On Dec 13, 5:32 am, Stefan Behnel wrote:
In Python 2.7/3.2, ElementTree has support for C14N serialisation, just
pass the option method="c14n".
Where does one find information in the Python documentation about
this?
Hmm, interesting. I though it had, but no
On Dec 13, 5:32 am, Stefan Behnel wrote:
...
> In Python 2.7/3.2, ElementTree has support for C14N serialisation, just
> pass the option method="c14n".
Where does one find information in the Python documentation about
this?
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Dec 13, 2011 at 12:43 PM, Joshua Landau
wrote:
> On 13 December 2011 19:34, Ian Kelly wrote:
>>
>> On Tue, Dec 13, 2011 at 1:34 AM, Joshua Landau
>> wrote:
>> >> No, there is another difference, the reason for rebinding the name.
>> >> In a subclass, you would rebind a class attribute be
On Dec 13, 5:32 am, Stefan Behnel wrote:
...
> In Python 2.7/3.2, ElementTree has support for C14N serialisation, just
> pass the option method="c14n".
Where in the Python docs can one find information about this?
[previous post disappeared, sorry if I double posted or replied to
author inadvert
Hi,
We are making a screen with data driven buttons. I can add buttons but
can't redraw the buttons for new values. The buttuns are placed in a
frame.
I draw the buttons on the screen in a for loop:
def drawS1Butons(self):
n=0
for self.S1 in self.Org.getVpuChilds(self.Focus):
On 13 December 2011 19:34, Ian Kelly wrote:
> On Tue, Dec 13, 2011 at 1:34 AM, Joshua Landau
> wrote:
> >> No, there is another difference, the reason for rebinding the name.
> >> In a subclass, you would rebind a class attribute because that
> >> particular attribute, which you need to change,
Serhiy Storchaka, 13.12.2011 19:57:
13.12.11 16:59, Stefan Behnel написав(ла):
It matches my opinion though.
I would be glad to divide your intentions, however ElementTree looks less
documented than minidom
It's certainly a lot smaller, which makes its API easier to learn and remember.
an
On Tue, Dec 13, 2011 at 1:34 AM, Joshua Landau
wrote:
>> No, there is another difference, the reason for rebinding the name.
>> In a subclass, you would rebind a class attribute because that
>> particular attribute, which you need to change, is used and expected
>> by external code, either in the
On 13Dec2011 00:30, Eelco wrote:
| On Dec 13, 1:27 am, alex23 wrote:
| > On Dec 13, 3:12 am, Eelco wrote:
| > > But to relate it to the topic of this thread: no, the syntax does not
| > > allow one to select the type of the resulting sequence. It always
| > > constructs a list.
| >
| > So by thi
On 13 December 2011 13:30, Jean-Michel Pichavant wrote:
>
> writing
>
> x = 1
>
> def spam():
> x = 2
>
> is in general a bad idea. That was my point.
Why? I have a few (probably wrong) guesses.
Because you expect it to be the same every time you use it?
Well, then this should be "in general a
13.12.11 16:59, Stefan Behnel написав(ла):
It matches my opinion though.
I would be glad to divide your intentions, however ElementTree looks
less documented than minidom, and is not full replacement. For example,
I haven't found how to get XML encoding. Also, at use of ElementTree
instead o
Andrea Crotti wrote:
I'm not sure for how long I had this bug, and I could not understand the
problem.
I had a function which would return a boolean
def func_bool():
if x:
return True
else: return False
Now somewhere else I had
if func_bool:
# do something
I could not qu
On Tue, Dec 13, 2011 at 1:44 AM, Eelco wrote:
> 'for i in llist' is not quite going to fly is it? Thats probably the
> reason noone ever uses that construct; its not a proper sequence type.
Not really a problem, because fortunately Python makes it super-easy
to create custom iterators.
def listi
On 2011-12-13, Pedro Henrique Guedes Souto wrote:
> On Tue, Dec 13, 2011 at 3:22 PM, prakash jp wrote:
>
>> Want to publish a log file as a web page, is there a parser to retain
>> the format of the text as is and then convert to html. Please provide
>> the relevant pointers
>
>
> Hey, You can us
Andrea Crotti wrote:
> I'm not sure for how long I had this bug, and I could not understand
> the problem.
>
> I had a function which would return a boolean
>
> def func_bool():
> if x:
> return True
> else: return False
>
> Now somewhere else I had
>
> if func_bool:
>
On Tue, Dec 13, 2011 at 3:22 PM, prakash jp wrote:
>
> Hi All,
>
> Want to publish a log file as a web page, is there a parser to retain the
> format of the text as is and then convert to html. Please provide the
> relevant pointers
Hey, You can use this: http://txt2tags.org/
Att;
Pedro Henri
On 2011-12-13, Andrea Crotti wrote:
> Now somewhere else I had
>
> if func_bool:
> # do something
>
> I could not quite understand why it was always true, until I finally
> noticed that the () were missing. Is there some tool to avoid these
> stupid mistakes? (pylint doesn't warn me on that)
Hi All,
Want to publish a log file as a web page, is there a parser to retain the
format of the text as is and then convert to html. Please provide the
relevant pointers
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
On 12/13/11 09:48, tinn...@isbd.co.uk wrote:
I want to sort a list of 'things' (they're fairly complex objects) by
the contents of one of the fields I can extract from the 'things'
using a Python function.
So I have a list L which is a list of objects of some sort. I can
output the contents of
Peter Otten <__pete...@web.de> wrote:
> tinn...@isbd.co.uk wrote:
>
> > I want to sort a list of 'things' (they're fairly complex objects) by
> > the contents of one of the fields I can extract from the 'things'
> > using a Python function.
> >
> > So I have a list L which is a list of objects of
And by the way suppose I have a script which takes as input the log
level and a list of possible filters.
In another file I have a couple of functions as below which are called
in that order.
Is that supposed to work?
In theory I'm getting both times the same logger.
The set_verbosity seems to do
hello
i am relatively new to python, so please be considerate...
i'm implementing a server and a client via raw_sockets.
i have the necessary privileges.
now, the server i defined so:
host = socket.gethostbyname(socket.gethostname())
address = (host, 4)
sockSer = socket.socket(socket.AF_INET,
gialloporpora writes:
> I would like to know how to obtain the path where script is executed
> and the path where the file script is stored.
Does this help:
In [16]: import os
In [19]: os.getcwd()
Out[19]: '/home/vince'
In [21]: os.__file__
Out[21]: '/home/vince/src/pyramid_install/lib/python
On Tue, Dec 13, 2011 at 6:36 AM, Henrik Faber wrote:
> Hi group,
>
> when decorating a method in Python3, by use of the
> functools.update_wrapper function, it can be achieved that the docstring
> and name of the original function is preseverved.
>
> However, the prototype is lost: When looking in
On 2011-12-13, gialloporpora wrote:
> Dear all,
> I would like to create a little script to rename my files, I think to
> use argparse module to create it.
> I would like to know how to obtain the path where script is executed and
> the path where the file script is stored.
>
> For example, if I
I'm not sure for how long I had this bug, and I could not understand the
problem.
I had a function which would return a boolean
def func_bool():
if x:
return True
else: return False
Now somewhere else I had
if func_bool:
# do something
I could not quite understand why it
On 12/13/2011 04:11 PM, Jean-Michel Pichavant wrote:
Not really, if you use the classic way, your subloggers should be
created an never configured. Their default behavior is to raise any
log event to its parent. That way, all event logs end up being handled
by the root logger.
Ok thanks now
tinn...@isbd.co.uk wrote:
> I want to sort a list of 'things' (they're fairly complex objects) by
> the contents of one of the fields I can extract from the 'things'
> using a Python function.
>
> So I have a list L which is a list of objects of some sort. I can
> output the contents of a field
Andrea Crotti wrote:
I think is simple but I can't get it to work as I wish.
Suppose I have a big application, my idea is that the running
script sets a global logging level and then all the imported modules
would act consequently.
In my codebase, however, unless I set the level for each of the
I want to sort a list of 'things' (they're fairly complex objects) by
the contents of one of the fields I can extract from the 'things'
using a Python function.
So I have a list L which is a list of objects of some sort. I can
output the contents of a field in the list as follows:-
for k in
I think is simple but I can't get it to work as I wish.
Suppose I have a big application, my idea is that the running
script sets a global logging level and then all the imported modules
would act consequently.
In my codebase, however, unless I set the level for each of the loggers
I don't get th
Serhiy Storchaka, 13.12.2011 15:27:
13.12.11 14:32, Stefan Behnel написав(ла):
I stripped my name from the quoted context because I didn't say this.
I am glad to hear this. ;)
It matches my opinion though.
I use xml.dom.minidom for XML canonization and convertion:
Do you mean "canonicali
13.12.11 14:32, Stefan Behnel написав(ла):
I stripped my name from the quoted context because I didn't say this.
I am glad to hear this. ;)
I use xml.dom.minidom for XML canonization and convertion:
Do you mean "canonicalisation"? I.e. C14N? That's not what the code
below is doing, not at al
On Tuesday, December 13, 2011 9:35:52 AM UTC+8, Steven D'Aprano wrote:
> On Mon, 12 Dec 2011 15:45:06 -0800, alex23 wrote:
>
> > On Dec 12, 10:49 pm, 8 Dihedral
> > wrote:
> >> This is the way to write an assembler or to roll out a script language
> >> to be included in an app by users.
> >
On 12/13/2011 10:59 AM, Andrea Crotti wrote:
So I have the following problem, I need something to copy a file to a
certain position
and restore it after.
So I wrote this simple context manager:
class WithCorrectEasyInstall(object):
def __enter__(self):
import pkg_resources
On 13 dec, 14:14, Chris Angelico wrote:
> On Tue, Dec 13, 2011 at 11:47 PM, Eelco wrote:
> >> def f(*args) *constructs* a tuple, it
> >> doesn't perform a type-check.
>
> > I am talking about type constraints... A type-check is something
> > along the lines of type(args)==list, a runtime thing an
Hi group,
when decorating a method in Python3, by use of the
functools.update_wrapper function, it can be achieved that the docstring
and name of the original function is preseverved.
However, the prototype is lost: When looking into the Python help, I
have lots of entries that look like:
getfoo
Steven D'Aprano wrote:
On Tue, 13 Dec 2011 10:54:51 +0100, Jean-Michel Pichavant wrote:
Steven D'Aprano wrote:
On Mon, 12 Dec 2011 12:13:33 +0100, Jean-Michel Pichavant wrote:
Using the same name for 2 different objects is a bad idea in general.
We have na
On Tue, Dec 13, 2011 at 11:47 PM, Eelco wrote:
>> def f(*args) *constructs* a tuple, it
>> doesn't perform a type-check.
>
> I am talking about type constraints... A type-check is something
> along the lines of type(args)==list, a runtime thing and something
> completely different. I havnt mention
On 13 dec, 12:13, Steven D'Aprano wrote:
> On Tue, 13 Dec 2011 01:15:46 -0800, Eelco wrote:
> > On Dec 13, 3:43 am, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote:
> >> On Mon, 12 Dec 2011 04:21:15 -0800, Eelco wrote:
> >> >> No more, or less, explicit than the difference between "==" a
On Tue, Dec 13, 2011 at 11:35 PM, Juan Perez wrote:
> My problem is thinking in windows console somewhat like linux shell, and do
> same things I did with pipes in C programming. But it seems not to be the
> case.
It is (at least, it supports the basics of pipes and redirection); but
what you're
Thank you for your responses,
My problem is thinking in windows console somewhat like linux shell, and do
same things I did with pipes in C programming. But it seems not to be the
case.
At a glance I dare say that sendkeys module is useful enough, but if I've
understood well, you only can send me
Serhiy Storchaka, 13.12.2011 13:17:
09.12.11 17:09, Dirkjan Ochtman wrote:
An at least somewhat informed +1 from me. The ElementTree API is a
very good way to deal with XML from Python, and it deserves to be
promoted over the included alternatives.
Let's deprecate the NiCad batteries and try to
09.12.11 17:09, Dirkjan Ochtman wrote:
On Fri, Dec 9, 2011 at 09:02, Stefan Behnel wrote:
An at least somewhat informed +1 from me. The ElementTree API is a
very good way to deal with XML from Python, and it deserves to be
promoted over the included alternatives.
Let's deprecate the NiCad batte
On 13 dec, 12:28, Steven D'Aprano wrote:
> On Tue, 13 Dec 2011 02:46:13 -0800, Eelco wrote:
> > With all this being said, I must say that the notion of indtroducing
> > type constraints into Python is quite a radical one*,
>
> Not that radical. Here's the creator of Python musing about adding
> op
09.12.11 17:09, Dirkjan Ochtman wrote:
On Fri, Dec 9, 2011 at 09:02, Stefan Behnel wrote:
An at least somewhat informed +1 from me. The ElementTree API is a
very good way to deal with XML from Python, and it deserves to be
promoted over the included alternatives.
Let's deprecate the NiCad batte
On 13/12/2011 11:21, Juan Perez wrote:
Well, if developers have to change something to the code, I'd continue
with autoit, since is closer to real enviroment. You are right, autoit
work by send parametres to GUI focused, but really I don't think it's
something necessary for my purposes as I need
On Tue, 13 Dec 2011 02:46:13 -0800, Eelco wrote:
> With all this being said, I must say that the notion of indtroducing
> type constraints into Python is quite a radical one*,
Not that radical. Here's the creator of Python musing about adding
optional type checks to Python:
http://www.artima.c
On Tue, Dec 13, 2011 at 10:21 PM, Juan Perez wrote:
> Well, if developers have to change something to the code, I'd continue with
> autoit, since is closer to real enviroment. You are right, autoit work by
> send parametres to GUI focused, but really I don't think it's something
> necessary for my
Well, if developers have to change something to the code, I'd continue with
autoit, since is closer to real enviroment. You are right, autoit work by
send parametres to GUI focused, but really I don't think it's something
necessary for my purposes as I need only send parameters to a windows cmd
con
On Tue, 13 Dec 2011 10:54:51 +0100, Jean-Michel Pichavant wrote:
> Steven D'Aprano wrote:
>> On Mon, 12 Dec 2011 12:13:33 +0100, Jean-Michel Pichavant wrote:
>>
>>
>>> Using the same name for 2 different objects is a bad idea in general.
>>>
>>>
>> We have namespaces precisely so you don
On Tue, 13 Dec 2011 01:15:46 -0800, Eelco wrote:
> On Dec 13, 3:43 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> On Mon, 12 Dec 2011 04:21:15 -0800, Eelco wrote:
>> >> No more, or less, explicit than the difference between "==" and
>> >> "is".
>>
>> > == may be taken to mean iden
Hi,
As a part of our reviewing program, we are giving away limited number
of copies (print & electronic) of our recent publication NumPy 1.5
Beginner's Guide to people interested in reviewing the book.
Book-link: http://link.packtpub.com/sibctR
You need to publish your review/feedback on either
So I have the following problem, I need something to copy a file to a
certain position
and restore it after.
So I wrote this simple context manager:
class WithCorrectEasyInstall(object):
def __enter__(self):
import pkg_resources
from shutil import copyfile
easy_insta
With all this being said, I must say that the notion of indtroducing
type constraints into Python is quite a radical one*, and one that
should not be taken lightly, so I understand the general conservative
vibe the notion is getting. It probably has implications beyond just
collection types, and if
On 13 dec, 11:15, Arnaud Delobelle wrote:
> On 13 December 2011 09:50, Eelco wrote:
>
> >> To answer that question: for the same reasons. The conversion is
> >> wasteful; allowing python to do the right thing based on a
> >> typeconstraint is not. Plus, it is less code, and more readable code;
>
On 13 December 2011 09:50, Eelco wrote:
>> To answer that question: for the same reasons. The conversion is
>> wasteful; allowing python to do the right thing based on a
>> typeconstraint is not. Plus, it is less code, and more readable code;
>> the only rule you have to learn is quite general, wh
> To answer that question: for the same reasons. The conversion is
> wasteful; allowing python to do the right thing based on a
> typeconstraint is not. Plus, it is less code, and more readable code;
> the only rule you have to learn is quite general, which is that :: is
> a type constraint annotat
On 2011-12-12, alex23 wrote:
> On Dec 12, 12:14 pm, Nick Irvine wrote:
>> What do people use to output live MIDI on Linux, assuming it's
>> possible?
> I've yet to try this myself although it's long been on my to-do list.
> There are a couple of packages on PyPI that emit MIDI:
> http://pypi.pyth
Steven D'Aprano wrote:
On Mon, 12 Dec 2011 12:13:33 +0100, Jean-Michel Pichavant wrote:
Using the same name for 2 different objects is a bad idea in general.
We have namespaces precisely so you don't need to care about making names
globally unique.
I don't get your point, name
On Mon, Dec 12, 2011 at 2:30 PM, Massi wrote:
> Hi everyone, I've just started to use pydev to develop my python
> application and I'm encountering some problems to debug it. The
> application I'm dealing with is a multithreaded application; when I
> try to debug it with pydev, it seems not to be
> > Python users generally follow the rule "explicit is better than
> > implicit". Setting a general constraint and letting the language "do
> > the right thing" is a kind of black magic that feels off because it
> > tends to break that rule. But that's not to say that black magic
> > never wins
On Dec 13, 3:43 am, Steven D'Aprano wrote:
> On Mon, 12 Dec 2011 04:21:15 -0800, Eelco wrote:
> >> No more, or less, explicit than the difference between "==" and "is".
>
> > == may be taken to mean identity comparison; 'equals' can only mean one
> > thing.
>
> Nonsense. "Equals" can be taken to m
On 12/10/2011 09:47 PM, Roy Smith wrote:
I've got a code pattern I use a lot. In each module, I create a logger
for the entire module and log to it all over:
logger = logging.getLogger('my.module.name')
class Foo:
def function(self):
logger.debug('stuff')
logger.debug('other
On Dec 13, 2:41 am, Ian Kelly wrote:
> On Mon, Dec 12, 2011 at 4:40 PM, Eelco wrote:
> >> For a linked list, no *target and no copying is needed:
>
> >> head, tail = llist
>
> > I have no idea what this means.
>
> Each node of a linked list consists of a data member and a "next"
> member, that ho
On Dec 13, 1:34 am, Ian Kelly wrote:
> On Mon, Dec 12, 2011 at 11:51 AM, Eelco wrote:
> > Either way, its not hard to add some detail to the semantics to allow
> > all this. Even this function definition:
>
> > def func(Foo(args), Foo(kwargs))
>
> > ...could even be defined unambigiously by overl
On Dec 13, 1:27 am, alex23 wrote:
> On Dec 13, 3:12 am, Eelco wrote:
>
> > But to relate it to the topic of this thread: no, the syntax does not
> > allow one to select the type of the resulting sequence. It always
> > constructs a list.
>
> So by this argument, _every_ function that returns a li
On 13/12/2011, Ian Kelly wrote:
> On Mon, Dec 12, 2011 at 4:48 PM, Joshua Landau
> wrote:
>> Rebinding logger locally in a function is really no
>> different to a subclass rebinding a variable from its main class using
>> that
>> class' value. The only difference is that, in that case, you have a
83 matches
Mail list logo