Why this code return error
AttributeError: 'tuple' object has no attribute 'join'
Any help will be appreciated;
Thanks
AttributeError: 'tuple' object has no attribute 'join'
Any help will be appreciated;
Thanks
Code:
import string
template_text = '''
Delimiter : %%
Replaced : %with_underscore
Ignored : %notunderscored
'''
d = { 'with_underscore' : 'replaced',
'notunderscored' : 'not replaced'
}
class MyTemplate(string.Template):
delimiter = '%',
idpattern = '[a-z]+_[a-z]+'
t = MyTemplate(template_text)
print 'Modified ID pattern:'
print t.safe_substitute(d);
Comment