On Oct 30, 4:16 am, Ben Finney wrote:
> Geoff Bache writes:
> > I'm wondering if there is any way to customize class attribute access
> > on classic classes?
>
> Why do that? What is it you're hoping to achieve, and why limit it to
> classic classes only?
>
I'm building a mocking tool, CaptureMo
On Sat, 29 Oct 2011 14:06:12 -0700, Geoff Bache wrote:
> Hi,
>
> I'm wondering if there is any way to customize class attribute access on
> classic classes?
>
> So this works:
>
> class Meta(type):
> def __getattr__(cls, name):
> return "Customized " + name
>
> class A:
> __met
Thanks for this Steven. I'm however gettings some pretty odd effects,
both on method access and inheritance. I expanded your example a
bit...
class Meta:
def __init__(self, name, bases, namespace):
self.__name__ = name
self.__bases__ = bases
self.__dict__ = namespace
On 30/10/2011 1:43 AM, Lee Harr wrote:
For Windows users who want to just run Pyguin (not modify or tinker
with the source code), it would be best to bundle Pynguin up with
Py2exe
I considered that, but I agree that licensing issues would make it
problematic.
What licensing issues concern you
To be honest, I was hoping someone would have posted a link to a well
known and tested recipe. You'd think this function would be in the
standard library or a specific Exception tied directly with setattr()
and getattr() (and possibly __getattr__(), __getattribute__(),
__setattr__())
The main thin
A c code snippet,the c file compiled to a dll file named libxxx.dll:
typedef void* HND;
typedef unsigned char UCHAR;
typedef short int SWORD;
...
int Connect(
HND* hnd,
UCHAR* ipaddr,
SWORD port){
..
return 1;
}
then How to handle function Connect using python and ct
Initializing a list of objects with one value:
class Order:
def __init__(self, ratio):
self.ratio=ratio
def __call__(self):
return self.ratio
ratio=[1, 2, 3, 4, 5]
Orders=[Order(x) for x in ratio]
But now I want to __init__ with 3 values:
class Order:
def __init__(self, ratio, bias, loc
Considering that the site is going to grow over time, putting the snippets in a
drop-down menu isn't a wise idea in my opinion.
Snippets on a separate page like activestate python would make it more
convenient.
Nice initiative, and would be very helpful when it grows over time.
--
http://mail.
On Mon, Oct 31, 2011 at 2:02 AM, Gnarlodious wrote:
> Orders=[Order(x,y,z) for x,y,z in [ratio, bias, locus]]
>
Assuming that you intend to take the first element of each list, then
the second, and so on, you'll want to use zip():
Orders=[Order(x,y,z) for x,y,z in zip(ratio, bias, locus)]
With
Hello,
I'd like to announce Pyrolite 1.3,
a tiny (~50k) Pyro client library for Java and .NET.
Q: "what is a java/.net library doing in this newsgroup?"
A.1: This library is meant to connect a Java or .NET program to Python in a
very simple
way, using the Pyro protocol. Pyro is my remote object
On Oct 30, 9:15 am, Chris Angelico wrote:
> Orders=[Order(x,y,z) for x,y,z in zip(ratio, bias, locus)]
Brilliant, thanks!
-- Gnarlie
--
http://mail.python.org/mailman/listinfo/python-list
>>> Py2exe
>>
>> I considered that, but I agree that licensing issues would make it
>> problematic.
>
> What licensing issues concern you? The py2exe license shouldn't be a
> problem and py2exe or something like it is good advice.
I think PyQt 4 would be the biggest issue. It is GPL 2 / 3.
I th
Maybe push something onto pip or easy_install?
On Fri, Oct 28, 2011 at 6:38 AM, Lee Harr wrote:
>
> I develop the free python-based turtle graphics application pynguin.
>
> http://pynguin.googlecode.com/
>
>
> Lately I have been getting a lot of positive comments from people
> who use the program
On 30/10/2011 15:02, Gnarlodious wrote:
Initializing a list of objects with one value:
class Order:
def __init__(self, ratio):
self.ratio=ratio
def __call__(self):
return self.ratio
ratio=[1, 2, 3, 4, 5]
Orders=[Order(x) for x in ratio]
But now I want to __init__ with 3 values:
cla
Hi!
Is there anyway to communicate with JavaScript inside a website opened via the
webbrowser module?
| import webbrowser
| webbrowser.open('http://python.org')
Here I'd like to do something like webbrowser.call('alert(1)')
and I'd like to be able to call the python app from javascript too.
I'
I'm trying to use distutils to install a collection of modules in
/usr/local/lib/python2.7/site-packages. My distribution (Fedora 15)
doesn't include any /usr/local paths in sys.path, so the import fails
when running the program. The distutils documentation suggests adding
a $NAME.pth file to an ex
Hi guys,
Here is the sample code
http://stackoverflow.com/questions/6389841/efficiently-find-binary-strings-with-low-hamming-distance-in-large-set/6390606#6390606
static inline int distance(unsigned x, unsigned y)
{
return __builtin_popcount(x^y);
}
Is it possible to rewrite the above gcc c
What would be an equivalent widget in ttk like a Listbox and if
possible a small example? I tried to look here
http://docs.python.org/library/ttk.html but did not see anything.
Maybe I did not look in the right place?
tia
--
http://mail.python.org/mailman/listinfo/python-list
18 matches
Mail list logo