I’m using python 2.6 and have a bunch of print statments in my long program. How can I replace them all with my custom print function, lets call it scribble(). Because if I just search and replace print with scribble( there is no closing parentesis. I think regular expressions is how, but I have experimented with them for a day or so and I can’t seem to get it to work.
Share
Using editor
I don’t know which editor you’re using, but if it supports RegEx search and replace, you can try something like this:
I tested this in Notepad++.
Using Python
Alternatively, you can do it with Python itself: