I have a class with many objects and I want to select using opt parse some function id = options.step ena = Rnaseq(options.configura, options.rst, options.outdir) now = datetime.datetime.now() ena.show() diz = {} for i,t in enumerate(ena.steps()): diz.setdefault(i,[]).append(t.__name__) for i in "ena."+"".join(diz[id])+"()":
print i.command 1 for i in "ena."+"".join(diz[id])+"()": 2 ----> 3 print i.command 4 AttributeError: 'str' object has no attribute 'command' here you se what they ouptut "ena."+"".join(diz[id])+"()" Out[85]: 'ena.trimmomatic() Definition: ena.trimmomatic(self) Source: def trimmomatic(self): """ Raw reads quality trimming and removing of Illumina adapters is performed using [Trimmomatic](http://www.usadellab.org/cms/index.php?page=trimmomatic). This step takes as input files: 1. FASTQ files from the readset file if available """ jobs = [] for readset in self.readsets: trim_file_prefix = os.path.join(self.pt,"trim", readset.sample.name, readset.name + ".trim.") trim_log = trim_file_prefix + "log" trim_stats = trim_file_prefix + "stats.csv" : Any suggestion in how to choose the function to use? M. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor