我如何将一行分隔成一个列表?

2024-04-19 04:12:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我想从这个enter image description here

对此

enter image description here

这是密码

    @commands.command() #PLAYERS INFO
    async def players(self,ctx,ADD,NUM):
        with SampClient(address=ADD, port=NUM) as client:
            players = [client.name for client in client.get_server_clients()]
            lst = [f'{players}']
            joined = '\n'.join(lst)    
            await ctx.send(f'```{joined}```')

Tags: selfinfoclientadd密码asyncdefnum