python - 不存在的行上的 Python 期望缩进
问题描述
我感到很困惑。我正在尝试使用 Python 和 Discord.py 制作一个 Discord 机器人。我已经从这里复制了示例代码,现在收到此错误:
File "C:/Users/****/Documents/Discord/RTSC/J'alami/bot.py", line 27
client.run(TOKEN)
^
IndentationError: expected an indented block
现在这是奇怪的事情。从我的代码中可以看出:
import discord
client = discord.Client()
client.run("{this string is secret}")
只有 3 行,到目前为止还不是错误所说的 27 行。
我对 Python 很陌生,所以我可能在这里遗漏了一些明显的东西。
我的 IDE 是 PyCharm 2020.1.1 社区版
非常感谢任何帮助,谢谢!
解决方案
推荐阅读
- c++ - 获得接近 2 次幂数的快速方法(浮点数)
- php - 从 Woocommerce 中的优惠券使用中排除具有 2 个特定属性术语的变体
- laravel - 使用预加载将原始 SQL 查询转换为 Laravel Eloquent
- c - 如何正确使用宏的功能?
- r - R,tmap:在视图模式下更改标签
- node.js - 内存中的 V8 BigInt 大小?
- c++ - 当参数转换为目标类型时,用于直接初始化的复制构造函数省略
- javascript - 从 JSON API 调用数组实例化对象?
- javascript - ChartJS 在通过 Animate CC HTML5 项目加载动画后消失
- python - 执行“groupBy()”时,多个 pyspark“window()”调用显示错误