登录
首页 » 汇编语言 » Python对文件IO操作

Python对文件IO操作

于 2022-03-02 发布 文件大小:2.67 kB
0 318
下载积分: 2 下载次数: 1

代码说明:

filePath="c:/test/tt.txt" #从文件中读取信息 f=open(filePath, "r")#运用读的方式打开文件, for line in f: #每次读取文件的一行内容      print(line) f.close() #向文件中写入信息 f=open(filePath, "a") #这里有两种方式:第一种是以w的形式,它写入时将会清空以前的数据然后再写入数据,第二种是以a的形式,它以追加的形式写入数据 f.write("我开始向文件中写入信息 ") f.writelines("我已经向文件写入了信息") f.close()

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 本程序实现液晶显示控制器SED1335的字符和汉字显示。 1.显示屏为320*240点阵 2.显示屏前128行为图形方式显示汉字,后112行为文本方式显...
    本程序实现液晶显示控制器SED1335的字符和汉字显示。 1.显示屏为320*240点阵 2.显示屏前128行为图形方式显示汉字,后112行为文本方式显示字符 3.汉字的Y坐标以象素点为单位,X坐标以8象素点为单位。-This program SED1335 LCD controller display of characters and Chinese characters. 1. Display of 320* 240 dot matrix 2. Display 128 acts of the former graphics display Chinese characters, act after the 112 character text display 3. Chinese characters Y coordinates to pixel-point unit, X pixel coordinates point to 8 units.
    2023-05-28 15:05:03下载
    积分:1
  • Braun to read the paper pattern on the screen and show tricks, badly written, al...
    读取百灵达的花样文件并在屏幕上显示出花样,写的不好,大家多多指教,新来的,哈哈。-Braun to read the paper pattern on the screen and show tricks, badly written, all the exhibitions, new to the PSP.
    2022-04-16 13:18:04下载
    积分:1
  • Student information system for students to display more information
    学生信息系统为学生显示更多的信息
    2022-03-22 01:06:05下载
    积分:1
  • fangmiandefhf H FFT
    fft fangmiandefhf h dgdfdgdgfhffj
    2022-02-07 08:07:51下载
    积分:1
  • ,片选接到p1.5 复位端 p1.4 中断端接到 int0 82c250工作在斜率模式下 ,RS 接51k电阻到地。 2,SJA10...
    ,片选接到p1.5 复位端 p1.4 中断端接到 int0 82c250工作在斜率模式下 ,RS 接51k电阻到地。 2,SJA1000与82C250的接口,逻辑上为SJA1000输出0(显性位),表现为低点平输出给82C250,则82C250输出 差分的低电平。SJA1000输出1(隐性位),表现为高电平或悬空输出给82C250,则82C250输出悬空状态。 3,周立功的中SJA_BCANCONF.ASM中对输出控制寄存器 的TX0的输出 极性的位的定义不对。 还有里面定义有接收错误标志码,不知道何时用。-, The election received a P1.5-chip client p1.4 interrupt reset int0 82c250 client received in the slope mode, RS then 51k resistor to ground. 2, SJA1000 with the 82C250 interface, logic for SJA1000 Output 0 (dominant bit), showing low level output to the 82C250, while the low-level differential output 82C250. SJA1000 Output 1 (recessive), and the performance of the output is high or left vacant to the 82C250, the vacant state 82C250 output. 3, Zhou Ligong in the SJA_BCANCONF.ASM of output control register TX0 output polarity bit the definition of wrong. Inside the definition also has to receive error flag code, I do not know when to use.
    2022-06-28 07:07:40下载
    积分:1
  • 这是使用汇编语言编写的一个从键盘接受输入,并在屏幕上显示的程序。其中可以输出大小写字符...
    这是使用汇编语言编写的一个从键盘接受输入,并在屏幕上显示的程序。其中可以输出大小写字符-This is the use of assembly language prepared to accept input from a keyboard and screen procedures. In which case characters can be output
    2023-07-21 14:45:02下载
    积分:1
  • 基于凌阳波形发生器的程序,产生三角波,方波,正弦波,100Hz~200KHz...
    基于凌阳波形发生器的程序,产生三角波,方波,正弦波,100Hz~200KHz-Sunplus based waveform generator procedure, resulting in the triangular wave, square wave, sine wave, 100Hz ~ 200KHz
    2022-10-02 03:50:03下载
    积分:1
  • AD9852驱动,可以产生任意波形。若果有不对的地方,请高手们批评指正。...
    AD9852驱动,可以产生任意波形。若果有不对的地方,请高手们批评指正。-AD9852-driven, can generate arbitrary waveform. If there is something wrong, please correct me experts have criticized.
    2022-10-29 04:10:03下载
    积分:1
  • 用汇编语言编写的简短小巧的记事本程序
    用汇编语言编写的简短小巧的记事本程序-assembler language short compact notebook procedures
    2023-03-26 16:25:04下载
    积分:1
  • Count of thousands of factorial, for computers and programmers is a challenge to...
    算十万的阶乘,对于计算机和程序员都是一个挑战,本源程序实现了求大数的阶乘,是用汇编写的,相对速度很快,算十万的阶乘在我赛扬2.4,内存256的神舟笔记本上,用了20多分钟.算出得数写在一个TXT文件下,十万的阶乘结果,用记事本打开,都要好一会儿.-Count of thousands of factorial, for computers and programmers is a challenge to realize the source of the order of the factorial of large numbers, is written in the compilation of a relatively quick, and counting of thousands of factorial in my 2.4 Celeron, memory 256 Shenzhou notebook, spent more than 20 minutes.得数calculated to write in a TXT file, the thousands of factorial results, use Notepad to open, should a good moment.
    2022-08-03 07:00:28下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载