我知道我不应该使用exec,因为它不安全,但是它运行的代码来自同一个文件,并且是一个字符串。如何使用exec运行异步函数?编辑:这是我使用exec的代码 async def command_processor(guild): commands = {"[1] - Bot Permissions"Bitte hier nur die Zahl eingeben")
if int(sel) in range(len(commands.
这是我的密码:def run():我想要覆盖任何打印语句或输出。使用string.replace方法和另一个函数是行不通的,因为如果有人使用像print("Use the print() function to send output in Python!")这样的代码,这将是个问题,人们可能希望使用函数名。我还想输出错误。
对于任何人说这是不安