Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with 语句语法问题 #683

Closed
1 task done
seal7 opened this issue Oct 10, 2024 · 4 comments
Closed
1 task done

with 语句语法问题 #683

seal7 opened this issue Oct 10, 2024 · 4 comments

Comments

@seal7
Copy link

seal7 commented Oct 10, 2024

⚠️ 搜索是否存在类似issue

  • 我已经搜索过issues,没有发现相似issue

📜 功能描述

在main.py 1418行中

1416    try:
1417        url_comments = []
1418        with (open(url_config_file, "r", encoding=text_encoding, errors='ignore') as file):

这里with后面的括号是什么新写法吗?我使用python3.6启动项目会报语法错误,把括号去掉就正常了

🌐 举例(可选)

No response

💡 动机

No response

📚 附加信息

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: with statement syntax problem

@ihmily
Copy link
Owner

ihmily commented Oct 10, 2024

@seal7

这种写法是在python 3.10支持的

参考更新日志:
https://docs.python.org/zh-cn/3.11/whatsnew/3.10.html
python/cpython#56991

在python 3.6你可以将括号去掉,但还是推荐在3.10版本以上运行本项目

@ihmily ihmily closed this as completed Oct 10, 2024
@seal7
Copy link
Author

seal7 commented Oct 10, 2024

学习了 感谢回复

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Learned. Thanks for the reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants