demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Demexp-dev] Questions


From: Lyu Abe
Subject: Re: [Demexp-dev] Questions
Date: Fri, 19 Oct 2007 00:19:08 +0900
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Hi David,

It can't work because those two mode are incompatible. Either you are
running a CGI script (i.e. a Python script that is launch each time
Apache handles an URL pointing to this script), or either you use
mod_python and your code runs on a Python interpreter /within/ Apache.

In both cases you should able to get form variables and HTTP headers
info. But you need to look at the correct doc. Haven't doing that
myself, I can't help you further.

Okay...

I suppose you are doing this only to get some HTML generated so you
can work on the CSS and the user interface.

However, if you plan to invest further in Python:
 * It might be wise to use an available framework the already do most
of the work to handle requests, prepare pages, etc. Django seems to be
a well known framework. We have listed some of them here:
https://demexp.org/dokuwiki/doku.php?id=en:web_client_development_framework

 * You can use the Python ONC-RPC interface (Thomas Petazzoni's
pydemexp) to talk to the demexp server. Once again, no hurry but for
the long term it might be better.

Yes sure. I'll try to look into that.

I have a detail question: when using the question_info method, questions are returned as a list, but in reversed order (the last question as the first element). Is there a very simple way of addressing elements in a reversed way in a list? My code is:

#to retreive the first 5 questions
question_test = s.question_info(cookie,0,5)

for qu in question_test[:]:
        ...
        #this is an example:
        unicode_data = qu['q_desc']
        req.write('<td colspan="4"><qu>%s</qu></td>' \
                %(unicode_data.encode('utf8')))
        ...


-Lyu.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]