View Single Post
Old 06-16-2016, 10:10 AM   #190
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@jbacelar

Thanks very much.

This code is working very well for one punctuation sign. I tried to make it work for a second one but I probably did something wrong because it failed. I have been told indentation is tricky but between theory and practice...

So, I tried this... No

Code:
def replace (match, number, file_name, metadata, dictionaries, data, functions, * args, ** kwargs):
     return match.group().replace ("!","@!")

def replace (match, number, file_name, metadata, dictionaries, data, functions, * args, ** kwargs):
     return match.group().replace ("?","@?")
Should I create several functions like your own or is there a way to concatenate several of them in a single one (or even better group several punctuation signs replacement in the same command)?
roger64 is offline   Reply With Quote