Newbie question about numpy

2006-08-24 Thread Paul Johnston
Hi I'm new to python and have just been taking a look at what it has to offer. I noted the lack of matrices so installed numpy I know the documentation is chargable so wanted a quick play to see if I should buy it However _ from numpy impo

Re: Newbie question about numpy

2006-08-25 Thread Paul Johnston
On Thu, 24 Aug 2006 17:23:49 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Thu, 24 Aug 2006 16:38:45 +0100, Paul Johnston ><[EMAIL PROTECTED]> declaimed the following in >comp.lang.python: > >> I know its a long time since my degree but that's

Unicode characters

2006-09-04 Thread Paul Johnston
Hi I have a string which I convert into a list then read through it printing its glyph and numeric representation #-*- coding: utf-8 -*- thestring = "abcd" thelist = list(thestring) for c in thelist: print c, print ord(c) Works fine for latin characters but when I put in a unicode cha

Detecting Updates on Arbitrary Objects

2009-03-13 Thread Paul Johnston
Hi, I would like to be able to install a code hook to detect updates on arbitrary objects. To give some background, I'm writing a web widget library, that uses request-local storage. If there's a mutable object on a widget (a dict is common), I'd like any attempts to update the dict to cause the d

jpeg package

2010-05-01 Thread Paul Johnston
Hi, I've used the jpeg library on PyPI in the past and it's been great: http://pypi.python.org/pypi/jpeg/0.1.4 However, the library home page is now unaccessible. I can't even find the library on archive.org. Any idea how I can get it? http://www.emilas.com/jpeg/ Thanks, Paul -- http://mail.py

class or instance method

2009-06-17 Thread Paul Johnston
Hi, I would like to have a method that is both a classmethod and an instancemethod. So: class MyClass(object): @class_or_instance def myfunc(cls_or_self): pass The semantics I'd like are: When you call MyClass.myfunc, it gets passed a class When you call MyClass().myfunc, it gets passed

Re: class or instance method

2009-06-21 Thread Paul Johnston
Hi, > class class_or_instance(object): >     def __init__(self, fn): ... This works a treat, thank-you. Paul -- http://mail.python.org/mailman/listinfo/python-list

Determining __name__ from the code that called a function

2009-07-27 Thread Paul Johnston
Hi, In ToscaWidgets 2 experimental, when defining resources you often do something like this: CSSLink(modname=__name__, filename='static/mycss.css') Now, what I'd like to do is make the "modname=__name__" optional, to make code more concise. I figure there must be some way (using inspect or somet