View Single Post
Posts: 6 | Thanked: 0 times | Joined on Dec 2005
#4
Originally Posted by bigboote
Andi,

I'm glad to hear you're working on this, and I hope your problem can be resolved. Having a mini httpserver on board could be a powerful tool.

Would you be so kind as to describe exactly (as in, instructions for Linux newbies) how you installed Python on your 770?

John
John,

Installing Python for Maemo is quite easy, there is a description on the Python for Maemo Page , but I'll summarize the steps for you:

1. Install the terminal emulation from http://770.fs-security.com/xterm/ on your 770 using the application installer.

2. Download the python packages from http://sourceforge.net/project/showf...roup_id=144664 , I'd recommend getting at least python2.4_2.4.1-2indt7_arm.deb and python2.4-modules_2.4.1-2indt7_all.deb if you want to do some serious programming.

3. Fire up your xterm and get root by typing "sudo /usr/sbin/gainroot"

4. Install the python packages by typing "dpkg -x python2.4-XXX_arm.deb /"

5. The python2.4-modules package doesn't contain the complete python standard library. To get full pythonic convenience when writing my little webserver, I copied the files cgi.py, BaseHTTPServer.py and SimpleHTTPServer.py from my desktop python installation (living in /usr/lib/python2.4/) to the same directory on my 770.

6. Have fun writing python code. A simple example for a python web server is:
Code:
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
host, port= '', 50000
print 'listening on port', port
srvr= HTTPServer((host, port), SimpleHTTPRequestHandler)
srvr.serve_forever()
Save this piece of code in a file called "srvr.py" and start it up by typing "python2.4 srvr.py". It will serve any files in its current directory.

Happy Hacking, Andi

Last edited by Andi; 2005-12-27 at 12:03.