繁体   English   中英

如何修复“x”未访问 Pylance

[英]How do I fix "x" is not accessed Pylance

它说“x”没有被访问 Pylance 但我不知道为什么它直到现在才起作用。 如果可以请帮忙。

troll3=  ["troll" , "ulikemen" , "someone-is-in-my-house" , ";/","amogsus"]   

@client.command()
@commands.has_permissions(administrator=True)
async def nuke(ctx):
    guild = ctx.guild
    await ctx.author.send(f'fake nuke command lol {ctx.author.mention}')
    for x in range(5):
        time.sleep(1)
        await ctx.send(f'[+] role: {(random.choice(troll3))} has been created')
    try:
        for channel in guild.channels:
            await ctx.send(f'channel: {channel.name} was deleted')
    except:
        await ctx.send('g')

在此处输入图片说明

如果您使用一些 linter/格式化程序(如 flake8、autopep8 等),您可以更改这些设置。 在 VSCode 上(从你的编辑器截图中猜测),你可以忽略特定的错误或警告。 (在这种情况下, F401是您要忽略的错误。)

path/to/.vscode/settings.json

{
    .
    .
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--ignore=E111, E114, E402, E501, F401"
    ],
    .
    .
}

或者更简单地说,您可以禁用 linting 或格式化包。

{
    .
    .
    "python.linting.flake8Enabled": false,
    .
    .
}

或者,您可以禁用 linting 或格式化本身。

{
    .
    .
    "python.linting.enabled": false,
    .
    .
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM