当前位置:网站首页>Syntaxerror resolved: positive argument follows keyword argument
Syntaxerror resolved: positive argument follows keyword argument
2022-07-28 00:52:00 【No envy】
resolved (Python Position parameter error )SyntaxError:positional argument follows keyword argument
List of articles
Error code
My code :
with open("text.txt", encoding='utf-8', "r") as f:
f.read()
Error message :
File "E:/Python Study /1.py", line 1
with open("text.txt", encoding='utf-8', "r") as f:
^
SyntaxError: positional argument follows keyword argument

Error reason
Translation of error reporting content : Grammar mistakes : Positional parameters follow keyword parameters
Error reason : There's this bug The reason is that the parameter position is incorrect ( Positional arguments , Sometimes called a required parameter , It means that the actual parameters must be passed to the function in the correct order , let me put it another way , The number and location of the actual parameters passed in when calling a function must be the same as when defining the function ), Keyword parameters must follow positional parameters . because python When the function parses parameters , It's in order , The position parameter must first meet , To consider other variable parameters .
resolvent
Modify code parameter location :
with open("text.txt", "r", encoding='utf-8') as f:
f.read()
Run again successfully :
边栏推荐
- 服务器中毒了——菜是原罪
- [bre] software build release automation
- Intel AI practice day issue 56 | explore new trends in industry development
- Rendering problems
- LeetCode - 寻找两个正序数组的中位数
- Microsoft Amazon layoffs, the economic crisis is getting closer...
- BuildForge 资料
- 自动推理的逻辑09–自动定理证明
- Can TSMC Samsung build a production line without American equipment for Huawei?
- The influence of head zeroing and tail zeroing on FFT output
猜你喜欢

Intel releases open source AI Reference Suite
![Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]](/img/e3/ea7278eb855cca2a1af4f96772bcb1.png)
Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]

Build Release Blogs

红队大杀器 Behinder_v4.0(冰蝎4.0)
![[bre] software build release automation](/img/c6/daead474a64a9a3c86dd140c097be0.jpg)
[bre] software build release automation

Intel joins hands with hanshuo and Microsoft to release the "Ai + retail" trick!

Camera and lidar calibration: gazebo simulation livox_ camera_ lidar_ Calibration ---- external parameter calibration calculation and result verification

Postman下载、使用教程

How to smoothly go online after MySQL table splitting?

In July, a software testing engineer came to the company. He looked like a hairy boy. He didn't expect to be the new generation of roll King
随机推荐
BuildForge 资料
Threejs personal notes
网络设备硬核技术内幕 防火墙与安全网关篇 (十)
ASML推出第一代HMI多光束检测机:速度提升600%,适用于5nm及更先进工艺
Point divide and conquer analysis
startUMl
Jerry Zhi has problems in real-time adjustment of sound change effect in magic sound mode [chapter]
Rongyun IM & RTC capabilities on new sites
英特尔携手汉朔、微软,释放“AI + 零售”大招!
Openvino integrates tensorflow to accelerate reasoning
MySQL limit使用及超大分页问题解决
Valued at $36billion! SpaceX, which is about to launch its first manned launch, raised $346million
[bre] software build release automation
mysql分表之后怎么平滑上线?
《KMP复习 + AC自动机》前传
How does matlab set the K-line diagram to classic red and green color matching?
Network device hard core technology insider firewall and security gateway (summary)
Network equipment hard core technology insider firewall and security gateway (V) security double repair method
【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]