Autocompletion in interactive mode doesn't work in 2.5.1

2007-06-11 Thread Papalagi Pakeha
Hi all,

How can I turn on autocompletion when I push  in python 2.5.1
interactive mode? E.g. to give me a list of all methods and attributes
of a given object.

It works great on my Linux / Ubuntu 7.04 installation but doesn't work
on Solaris 10 (x86). I have libreadline.so and libncurses.so installed
and "import readline" is executed during startup, but  still
doesn't work. ArrowUp and ArrowDown however work and I can browse the
history of commands so I believe readline is installed and loaded
correctly.

Any hints?

Thanks

PaPa
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Autocompletion in interactive mode doesn't work in 2.5.1

2007-06-12 Thread Papalagi Pakeha
On 6/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Jun 12, 9:36 am, "Papalagi Pakeha" wrote:
> > Hi all,
> >
> > How can I turn on autocompletion when I push  in python 2.5.1
> > interactive mode? E.g. to give me a list of all methods and attributes
> > of a given object.
>
> http://docs.python.org/lib/module-rlcompleter.html

That's it! Thanks heaps :-)

PaPa
-- 
http://mail.python.org/mailman/listinfo/python-list


Installing manpage in setup.py

2007-06-16 Thread Papalagi Pakeha
Hi all,

how can I tell setup() in distutils' setup.py to install manual pages
of my program? I.e. prgclient.1 to /.../man/man1 and prgdaemon.8 to
/.../man/man8? The problem is that those /.../ directories may be
different on every system, for instance /usr/share/man on OpenSUSE and
/usr/man on Solaris. Is there a way to automatically put the manpages
to their proper directories?

Thanks

PaPa
-- 
http://mail.python.org/mailman/listinfo/python-list


How to find script's directory

2007-08-19 Thread Papalagi Pakeha
Hi,

I have a project (a django project actually) that has a structure
something like:
/path/prj/settings.py
/path/prj/scripts/blah.py
/path/prj/...

In order to run blah.py I need to set $PYTHONPATH to /path/prj because
it does "import settings". That's all good. I would however like to
autodetect the path in blah.py somehow and not need to set PYTHONPATH
prior to execution.

Whether it's called as /path/prj/scripts/blah.py or ./blah.py or
../../prj/scripts/blah.py or even plain blah.py should the whole path
to it be in $PATH I'd like it to detect it's location in the
filesystem and append its parent dir to sys.path

I guess I could do it with a little help of os.path.realpath() for all
those cases where absolute or relative path was used. But how should I
approach it when it's invoked as plain 'blah.py' because its directory
name is in $PATH?

TIA!

PaPa
-- 
http://mail.python.org/mailman/listinfo/python-list


numpy confusion

2007-10-23 Thread Papalagi Pakeha
Hi all,

I'm trying to do some calculations with NumPy but apparently didn't
quite got the basics. For example I need Exponential Moving Average
function. That is, I have an array of values and want to apply a
function F(current, previous) to each element of the array. How can I
pass the 'previous' element to the function? In plain python it would
be a simple loop:

for index in arange(len(in_data[1:])):
result[index] = F(in_data[index], result[index-1])

I assume it's somehow possible with numpy.frompyfunc() and actually
found one example in SciPy TimeSeries library. Unfortunately I don't
fully understand how that one works :-/

Is anyone able to shed some light on this thing?

Thanks

PaPa
-- 
http://mail.python.org/mailman/listinfo/python-list