Wednesday, May 25, 2005

Python tip:

urlopen(siteurl, [postdata])
-------------------------------
If you want GET (like open a page in a browser) just omit postdata like urlopen('http://google.com')
If you want POST (like sending a form) include postdata - values for all form variables.

Data must be prepared for HTTP transfer, that's what is urlencode for.
It takes sequence of pairs or dictionary. Dictionary constructor is convinient as you can use var names as keywords.

So all you need is to get all vars (visible and hidden all alike) and get them values.
To actually perform operation you usually .read() result of urlopen.

Monday, May 23, 2005

5/23/2005

To start httpd under FreeBSD (just so I won't forget):

/usr/local/sbin/apachectl restart
or
/usr/local/etc/rc.d/apache2.sh restart

rt3 is installed in /usr/local/rt3

mysql:

/usr/local/etc/rc.d/mysql-server.sh restart