Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def change_deco(name, deco, placeholder=' #'):
- with open(name + '.py', 'r') as file:
- lines = file.readlines()
- for idx, string in enumerate(lines):
- if placeholder in string and repr(placeholder) not in string:
- lines[idx] = f' @{deco}\r\n'
- exec(''.join(lines))
- return locals()[name]
Add Comment
Please, Sign In to add comment