Pyrot schrieb:
class rawDNA:
import string
Importing here is unusual. Unless you have good reasons to do so, I
suggest you put the imports on top of the file.
trans = string.maketrans("GATC","CTAG")
def __init__(self, template = "GATTACA"):
self.template = template //shouldn't this make "template"
accessible within the scope of "rawDNA"??
No.
def noncoding(self):
print template.translate(trans) //
This needs to be
print self.template.translate(trans)
Thes scopes insied a class are only the method-locals (to which the
parameters count of course), and globals.
Diez
--
http://mail.python.org/mailman/listinfo/python-list