栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

[未解决问题]MAC系统shell脚本

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

[未解决问题]MAC系统shell脚本

Exception ignored in: <_io.TextIOWrapper name=’’ mode=‘w’ encoding=‘utf-8’> BrokenPipeError: [Errno 32] Broken pipe

test.sh内容:

#!/bin/bash
echo 0 4|python3 quiz.py|>tResults.txt

执行脚本:

chmod 777 test.sh
./test.sh

报错:

Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

尝试:

  • 加“;”,没用
  • 删除管道符‘|’前后的空格,没用
  • 直接在终端命令行输入命令,可执行

结果:
怀疑是管道符的问题

参考链接:
https://blog.csdn.net/weixin_31856057/article/details/116820604

https://www.jianshu.com/p/80d8ba1c85ef

https://unix.stackexchange.com/questions/621794/exception-ignored-in-io-textiowrapper-name-stdout-mode-w-encoding-utf

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/280588.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号