H
H
hzwxcv2021-07-25 04:18:27
Python
hzwxcv, 2021-07-25 04:18:27

Syntax error about File “”, line 1, what does it mean?

I'm trying to run this script to issue roles:

from discord.ext import commands
from discord.utils import get
import discord

bot = commands.Bot(command_prefix='/')

@bot.command(pass_context=True)
@commands.has_role("123") # This must be exactly the name of the appropriate role
async def addrole(ctx):
    member = ctx.message.author
    role = get(member.server.roles, name="Test")
    await bot.add_roles(member, role)

    client = MyClient()
client.run('Тут стоит мой токен :) ')


Next, I write to the console python GGG.py
Gives an error
```
: The name "python" is not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name and the presence and
correctness of the path, then try again.
line:1 character:1
+ python GGG.py
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException `
` ` yntaxError: invalid syntax >>> & C:/ProgramData/Anaconda3/python.exe c:/Users/lenovo/Desktop/python/GGG.py File "", line 1

& C:/ProgramData/Anaconda3/python.exe c:/Users/lenovo/Desktop/python/GGG.py
```

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2021-07-25
@hzwxcv

It was necessary to check the box when installing Python Add python 3.X to PATH.
Now this must be done by hand, the instructions are easy to google.
UPD:
60fcc59040717741922701.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question