使用Python读写记事本文件 [英] Read and Write a notepad file using Python

查看:700
本文介绍了使用Python读写记事本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai我是python编程的初学者

我想使用
读写记事本文件
python中的类和方法.

有人可以帮我吗?

任何帮助将不胜感激.

我已将记事本文件内容粘贴到下面以进行处理
由于我找不到任何附件选项,请记下
验证.

文件名:FileToRW.txt

记事本文件的内容
-------------------


红色的;黑色的;绿色;白色的;粉色的;橙色;

R100; B100; G100; W100; P100; O100;
R200; B200 G200 W200 P200 O200
R300; B300; G300; W300; P300; O300;
R400; B400; G400; W400; P400; O400;


"RUN 100"
执行颜色代码"
"RESULT 1100"

Hai I am beginner in python programming

I want to read and write a notepad file using

a class and method in python.

Can anyone help me to do so ?

Any help will be appreciated.

I have pasted the notepad file content to be processed below
since I don''t find any attachment option, please note down for
the verification.

filename : FileToRW.txt

Content of Notepad File
-------------------


RED; BLACK; GREEN; WHITE; PINK; ORANGE;

R100; B100; G100; W100; P100; O100;
R200; B200 G200 W200 P200 O200
R300; B300; G300; W300; P300; O300;
R400; B400; G400; W400; P400; O400;


"RUN 100"
"EXECUTE COLOR CODES"
"RESULT 1100"

推荐答案

没有记事本文件"之类的东西.

Python文件读/写是如此简单(即使对于绝对的初学者而言),除了可能为您编写代码外,我不知道您可能需要什么答案.
不,这不是CodeProject的工作方式.如果您遇到任何问题,请阅读代码并提出问题.而且对您来说更好.初学者是那些开始的人.

除了以下内容,我什么也没用: http://www.python.org/doc/ [ http://webpython.codepoint.net/wsgi_tutorial [^ ].

—SA
There is no such thing as "notepad file".

Python file read/write is so simple (even for an absolute beginner) that I have no idea what answer you may need, except perhaps writing the code for you.
No, this is not how CodeProject works. Please read the code and ask a question if you face any problems. And it''s better for you. Beginners are those who begin.

I never used anything but this: http://www.python.org/doc/[^]

I''m not talking about WSGI, this is different story. Do you do Web development with Python? This is a bit tricky (but very nice after you learn WSGI techniques and documentation. For me, all I needed is well covered here: http://webpython.codepoint.net/wsgi_tutorial[^].

—SA


这篇关于使用Python读写记事本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆