So say that I have a python v2.7 file with some code like this:
print 'asdf' print 'hi mom!'
But I want to run it in python3, I will need to add those brackets to them:
print('asdf') print('hi mom!')
I tried to use the following regex in vim to solve the problem, but it did not work:
:%s/print\ '.*'/print('\1')/gc
He just gave me print functions (with parentheses) that had blank lines. Any help is appreciated; thanks.
source share