Re: WxPython and TK

2011-08-07 Thread Steven D'Aprano
On Mon, 8 Aug 2011 10:26 am azrael wrote: > Today I found a quote from Guido. > > wxPython is the best and most mature cross-platform GUI toolkit, given a > number of constraints. The only reason wxPython isn't the standard Python > GUI toolkit is that Tkinter was there first. -- Guido van Rossum

how to invoke a bat file on a remote machine

2011-08-07 Thread prakash jp
Hi all, Want to know how to invoke a bat file on a remote machine. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython and TK

2011-08-07 Thread Gregory Ewing
azrael wrote: If I would have gotten a dollar for every time I talked to someone in a company about why they dont use python for their products and I was served the answer "Well it kind of sucks in GUI development", I would be a millionaire. Even assuming that Python + wxPython sucks less than

Re: Restricted attribute writing

2011-08-07 Thread John O'Hagan
On Mon, 08 Aug 2011 03:07:30 +1000 Steven D'Aprano wrote: > John O'Hagan wrote: > > > I'm looking for good ways to ensure that attributes are only writable such > > that they retain the characteristics the class requires. > > That's what properties are for. > > > My particular case is a class

Re: WxPython and TK

2011-08-07 Thread Ian Kelly
On Sun, Aug 7, 2011 at 6:26 PM, azrael wrote: > Today I found a quote from Guido. > > wxPython is the best and most mature cross-platform GUI toolkit, given a > number of constraints. The only reason wxPython isn't the standard Python GUI > toolkit is that Tkinter was there first. > -- Guido van

Re: Wait for a keypress before continuing?

2011-08-07 Thread John Doe
Steven D'Aprano wrote: > Also, are you using an IDE? If so, it could very well be > interfering with the keyboard buffer I really don't know how to answer your question. I am using Windows XP SP3. Komodo Edit 6 for editing the *.py file. Dragon Naturally Speaking, Natlink, and Dragonfly mig

Re: module import error, what's wrong?

2011-08-07 Thread Gelonida N
On 08/08/2011 02:45 AM, smith jack wrote: > from common.URLTool import URLTool could it be that you meant from common import URLTool As I don't know the module 'common' I am just guessing > tool = URLTool() > > Traceback (most recent call last): > File "E:\workspace\url\test.py", line 7, in

WxPython and TK

2011-08-07 Thread azrael
Today I found a quote from Guido. wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first. -- Guido van Rossum OK, now. Isn't it maybe time to throw out TK once

module import error, what's wrong?

2011-08-07 Thread smith jack
from common.URLTool import URLTool tool = URLTool() Traceback (most recent call last): File "E:\workspace\url\test.py", line 7, in ? from common.URLTool import URLTool ImportError: No module named common.URLTool URLTools is a class write by myself, it works well ,but cannot be imported in t

Re: Wait for a keypress before continuing?

2011-08-07 Thread Steven D'Aprano
John Doe wrote: > My program does not need a prompt, it just needs to wait for any > key to be pressed before it continues. This is in Windows. > > char=0 > while not char: > char=msvcrt.getch() > > That doesn't delay anything here. Works perfectly for me. You don't need the while loop,

Wait for a keypress before continuing?

2011-08-07 Thread John Doe
My program does not need a prompt, it just needs to wait for any key to be pressed before it continues. This is in Windows. char=0 while not char: char=msvcrt.getch() That doesn't delay anything here. while 1: char=msvcrt.getch() break That appears to put my program into an

Re: import hooks (PEP 302) broken in Python >=2.5?

2011-08-07 Thread Ryan Kelly
On Sun, 2011-08-07 at 11:11 -0700, Josh Haberman wrote: > When reading about import hooks, I came across a blog entry comment > that says: > > One additional thing to note about ihooks is that it's > somewhat seriously broken on Python 2.5 and newer and there > seems to be little or no inter

Re: PyPI Situation?

2011-08-07 Thread Ned Deily
In article , Redmumba wrote: > I've been running into a lot of issues with the PyPI architecture, and I'm > aware that there's some work going on behind the scenes, especially with > making PyPI accessible from the a cloud-like architecture. PyPI is discussed on the Python Catalog SIG mailing l

Re: __set__ method is not called for class attribute access

2011-08-07 Thread Duncan Booth
Peter Otten <__pete...@web.de> wrote: > Duncan Booth wrote: > >> The descriptor protocol only works when a value is being accessed or set >> on an instance and there is no instance attribute of that name so the >> value is fetched from the underlying class. > > Unlike normal class attributes a d

help with DLL or path issue trying to use cx_Freeze

2011-08-07 Thread Bart Manchester
I suspect this may have gone out before I was a member, and thus potentially not be received - apologies if this did go out please ignore this second attempt if it did. --- Im trying to use the most basic of cx_Freeze in a dos window and I receive the following error (see below). I

Re: import hooks (PEP 302) broken in Python >=2.5?

2011-08-07 Thread Steven D'Aprano
Josh Haberman wrote: > When reading about import hooks, I came across a blog entry comment > that says: > > One additional thing to note about ihooks is that it's > somewhat seriously broken on Python 2.5 and newer and there > seems to be little or no interest in fixing it. It's > probabl

Re: Restricted attribute writing

2011-08-07 Thread Chris Angelico
On Sun, Aug 7, 2011 at 6:07 PM, Steven D'Aprano wrote: > class ThingWithTwoIntegers(object): > I'm not a lisp expert, but this might well be called a cons cell. Or a "pair". ChrisA -- http://mail.python.org/mailman/listinfo/python-list

import hooks (PEP 302) broken in Python >=2.5?

2011-08-07 Thread Josh Haberman
When reading about import hooks, I came across a blog entry comment that says: One additional thing to note about ihooks is that it's somewhat seriously broken on Python 2.5 and newer and there seems to be little or no interest in fixing it. It's probably worth *always* avoiding when writi

Re: how to separate a list into two lists?

2011-08-07 Thread Gelonida N
On 08/07/2011 02:07 AM, Steven D'Aprano wrote: > Gelonida N wrote: > >> Asuming you [Bud] are not an alias of Jack Smith and assuming you did >> not see Jack's thread asking the same question: > > That's a strange thing to say when Bud *answered* Jack's question. > > >> x,y = unzip(*L) > > W

Re: Restricted attribute writing

2011-08-07 Thread Steven D'Aprano
John O'Hagan wrote: > I'm looking for good ways to ensure that attributes are only writable such > that they retain the characteristics the class requires. That's what properties are for. > My particular case is a class attribute which is initialised as a list of > lists of two integers, the fir

PyPI Situation?

2011-08-07 Thread Redmumba
I've been running into a lot of issues with the PyPI architecture, and I'm aware that there's some work going on behind the scenes, especially with making PyPI accessible from the a cloud-like architecture. However, I setup a Python mirror (using the pep381client) for our company, and the issue is

Re: Restricted attribute writing

2011-08-07 Thread Rafael Durán Castañeda
The assert on Order should be an if ... raise, like OrderElement, sorry for the mistake and repost El 7 de agosto de 2011 18:53, Rafael Durán Castañeda < rafadurancastan...@gmail.com> escribió: > I think you might use a tuple instead of a list for OrderElement, that > would make much easier your

Re: Restricted attribute writing

2011-08-07 Thread Rafael Durán Castañeda
I think you might use a tuple instead of a list for OrderElement, that would make much easier your code: class OrderElement(tuple): def __new__(cls, x, y): if not isinstance(x, int) or not isinstance(y, int): raise TypeError("Order element must receives two integers")

Re: Restricted attribute writing

2011-08-07 Thread Steven D'Aprano
Roy Smith wrote: > In article , > John O'Hagan wrote: > >> I'm looking for good ways to ensure that attributes are only writable >> such that they retain the characteristics the class requires. > > Sounds like you're trying to do > http://en.wikipedia.org/wiki/Design_by_contract. Which is not

Re: Restricted attribute writing

2011-08-07 Thread Roy Smith
In article , John O'Hagan wrote: > I'm looking for good ways to ensure that attributes are only writable such > that they retain the characteristics the class requires. Sounds like you're trying to do http://en.wikipedia.org/wiki/Design_by_contract. Which is not a bad thing. But, I think

Restricted attribute writing

2011-08-07 Thread John O'Hagan
I'm looking for good ways to ensure that attributes are only writable such that they retain the characteristics the class requires. My particular case is a class attribute which is initialised as a list of lists of two integers, the first of which is a modulo remainder. I need to be able to wr

Re: PEP 372 -- Adding an ordered directory to collections

2011-08-07 Thread Lucio Santi
Hi all, I'm a first-time writer here, so excuse me if I say something inappropriate or such. Last week, I was reviewing some Python 2.7 modules when I came across the OrderedDict data structure. After seeing its official implementation and also after reading through the corresponding PEP, I figur

Re: how to dynamically generate __name__ for an object?

2011-08-07 Thread Eric Snow
On Sat, Aug 6, 2011 at 10:47 PM, Steven D'Aprano wrote: > Eric Snow wrote: > >> Thought I knew how to provide a dynamic __name__ on instances of a >> class.  My first try was to use a non-data descriptor: > > Perhaps you should explain what you are trying to do. If you want to give > instances the