samedi 30 juillet 2016

replace semicolon by newline in python code

I would like to parse Python codes that contain semicolons ; for separating commands and produce code that replaces those by newlines n. E.g., from

def main():
    a = "a;b"; return a

I'd like to produce

def main():
    a = "a;b"
    return a

Any hints?

Aucun commentaire:

Enregistrer un commentaire