首页 > 编程知识 正文

python怎么创建文本文件,python创建一个空txt文件

时间:2023-05-06 11:25:52 阅读:19958 作者:4300

http://www.Sina.com/http://www.Sina.com /

创建名为mytxtfile的txt文件,然后单击msgdeftext_create(name, msg ) :写入desktop _ path=' c : (_ SERS ) _administration )文件' #新创建的txt文件的存储路径full _ path=desktooth 也可以为. doc创建word文档file=open(full_path,' w ' ) file.writt # file.close (text _ create ) ' mytxtfile ) #调用函数创建名为mytxtfile的. txt文件,并将其写入Hello world! 结果是这样的:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。