简体   繁体   中英

How do I fix "x" is not accessed Pylance

It says "x" is not accessed Pylance But I don't know why it used to work until now. If you can please help.

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')

在此处输入图片说明

If you use some linter/formatter(like flake8, autopep8, etc..), you can change these settings. On VSCode(to guess from your editor screenshot), you can ignore specific errors or warnings. (in this case, F401 is what you want to ignore error.)

In path/to/.vscode/settings.json

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

Or more simply, you can disable linting or formatting package.

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

Or, you can disable linting or formatting itself.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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