Access Database Using Python

Karthish karthish at
Mon Jun 13 21:50:00 CEST 2005

I'm writing a script to look through DNA sequences in a database and
select sequences I require. So far, my code looks like this for

import os
import Bio.Clustalw
from Bio.Alphabet import IUPAC
import pdb
import sys
import os
import urllib
import urllib2

import urllib
userid = 'kmdawg'
password = 'kmdawgyeah'
location = 'index.html'
params = urllib.urlencode({'user': userid, 'password': password,
'request_uri': location})
f = urllib2.urlopen("" % params)

When I run the program, I see the following:

  <META http-equiv="pragma" content="no-cache">
  <META http-equiv="cache-control" content="no-cache">
  <META http-equiv="expires" content="0">
  <META http-equiv="refresh" content="1; URL=index.html"></HEAD><BODY
<h1>Please stand by, you will be redirected

The code works as it is. How would I modify this script to display the
I can't figure out how to authenticate and then load a page, since the
page requires cookies for authentication. 


More information about the Python-list mailing list