我想做一个类似于python中字符串的内置函数的函数。
例如: foo.upper()
我不想制作一个对象来执行此操作,只需使用类中的简单函数更改字符串即可。
这是代码将类似于
class autokey():
def encrypt(self, string, key):
# * Code to encrypt message *
return encrypted_message
string = "test"
print(string.autokey.encrypt())