为了账号安全,请及时绑定邮箱和手机立即绑定

为什么 ??当我将一个文本文件复制到另一个时出现?

为什么 ??当我将一个文本文件复制到另一个时出现?

守候你守候我 2021-09-28 19:04:23
当我将一个文本文件复制到另一个文本文件时,新文件的末尾有两个字符:(??),这是我不想要的。我在 Windows7 上使用 Python3.6.0这是我的脚本:from sys import argvscript, from_file, to_file = argv#Open from_file and get the text from itindata = open(from_file).read()#Write the from_file text to to_fileopen(to_file, 'w').write(indata)我在 PowerShell 中运行以下命令:>echo "This is a test file." > TestSource.txt>type TestSource.txtThis is a test file.>python CopyFile.py TestSource.txt TestDestination.txt>type TestDestination.txtThis is a test file.??为什么我创建的文件中会出现两个问号 (??)?编辑:此相关问题被建议为重复。我的问题是当我将一个文本文件复制到另一个文本文件时 Python 的行为。这个相关问题是关于 Windows PowerShell 如何创建文本文件的。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 147 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号