converting textobject to name of other object.

Lars Tengnagel lars at
Tue Dec 7 23:29:04 CET 2004

I'm trying to use the matrix variable to collect a matrix in the file 
MatrixInfo which contains a lot of different matrices. Yhe commented line is 
the problem.
HOW ???????

import re
import MatrixInfo

class Diff:
    def __init__(self,filobj,matrix='pam250',begin=0,end='none'):
        self.fil = filobj
        self.begin = begin
        self.end = end
        if matrix in MatrixInfo.available_matrices:
######self.matrix =MatrixInfo.matrix
            self.matrix= MatrixInfo.pam250
        else print "matrix don't exist %s" %matrix
        self.dict = {}

Thanks Lars 

More information about the Python-list mailing list