Hi Ognajen
I'm the one who wrote the simple python plugin.
Let me begin with telling you a bit about my motivation
before we get down to the details.
I needed a way to display the network statistics on
a per calendar month basis. i.e. the total RX and TX bytes
of eth0. And i needed the data to be 4Gb-overflow-aware,
persistent and crash/unexpected-reboot resistant.
I've written the python code for this and i will soon release the code
in the lcd4linux contrib section. I've just been so darn bizzy
with other projects this last few months...
> I have noticed the addition of a python plugin to the documentation wiki
> (under plugins). What exactly is this plugin and what does it do?
As of version 0.10.0 the python plugin is only a very rudimentary
embedded python interpreter. With it your widgets can execute
a limited set of python functions (functions that takes one argument
and returns a string)
In the near future i will spend some time to make the plugin more
generic. e.g. support for the all of the datatypes supported by
the lcd4linux evaluator, arbitary number of arguments to the function,
and more...
> I presume it provides python bindings to lcd4linux, if this is the case
> how would I go about using it (the wiki still has a blank page for it).
I've experienced some problems compiling 0.10.0 version of lcd4linux
with python support. This is what i had to do to make it work:
export python_path="just about anything"
export PYTHON_LDFLAGS=-lpython2.3
export PYTHON_CPPFLAGS=-I/usr/include/python2.3
./configure --prefix=/usr --with-python
-----
Here is an example widget using the python plugin:
Widget PythonTest {
class 'Text'
expression python::exec('atest','test','ignored')
length 8
direction 'E'
update 10
}
-----
And here is the contents of the example python file, named atest.py.
(put the file in your site-packages or point to it with $PYTHON_PATH:
def test(ignored=0):
return "test"
---
> Also for a project I am doing (in python no less) I need keypad support,
> and till now i used lcdproc. Unfortunatly lcdproc doesnt seem up to the
> job, so I was wondering if lcd4linux will have any keypad support soon.
That's something for Michael :)
> I am willing to test the python (and keypad aspects) if you need any help.
Great! I've done some basic testing on the python-c-memory allocations
with valgrind. But i really don't know what the 'normal' python memory
footprint looks like. Maybe you knows how to test that?
regards
/Dan
|