Diez B. Roggisch schrieb:
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)
Ah, sorry, that should have been
self.template.translate(self.trans)
Diez
--
http://mail.python.org/mailman/listinfo/python-list