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

Python对文件IO操作

于 2022-03-02 发布 文件大小:2.67 kB
0 310
下载积分: 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 个回复

  • AVRSTUDIO中文HELP AVRSTUDIO中文HELP
    AVRSTUDIO中文HELP AVRSTUDIO中文HELP-HELP AVRSTUDIO Chinese AVRSTUDIO Chinese HELP AVRSTUDIO中文HELP
    2023-01-18 11:30:04下载
    积分:1
  • 还是一个asm编的VXD例子
    还是一个asm编的VXD例子-asm or a series of examples VXD
    2023-04-16 10:35:03下载
    积分:1
  • 8951系列延时子程序——汇编语言
    我自己用的汇编语言子程序,分享给大家。有不愿意自己琢磨的朋友可以拿来就用。 我会陆续上传我的应用。 希望能对朋友们有所帮助。
    2022-07-03 23:01:06下载
    积分:1
  • COMPUTER LANGUAGE
    8086的汇编语言指令表,是8086指令表的集合,是比较全的指令表-COMPUTER LANGUAGE
    2022-07-14 02:21:27下载
    积分:1
  • 我在汇编课上完成的一些作业(上机常见习题)和汇编课本上的几个例题,常用的输入输出模块,如: 把压缩存放的BCD码,转换为对应十进制数字ASCII码的程序;编...
    我在汇编课上完成的一些作业(上机常见习题)和汇编课本上的几个例题,常用的输入输出模块,如: 把压缩存放的BCD码,转换为对应十进制数字ASCII码的程序;编写从键盘键入0至9中任一自然数x,求其立方值;内存中以BUFFER为首地址的缓冲区有10个非压缩型BCD码形式存放的十进制数,它们的值可能是0~9中的任意一个,将这些十进制数顺序显示在屏幕上等等,-I completed classes in the compilation of a number of operations (on the machine common exercises) and the compilation of textbooks on a few examples of commonly used input and output modules, such as: the compressed storage of BCD code, converted to decimal ASCII code corresponding to the procedure prepared from the keyboard type 0-9 in any natural number x, for the cubic value memory to buffer BUFFER headed Address has 10 non-compression type BCD code stored in the form of a decimal number, their value may be 0 ~ 9 any one of these decimal number sequence displayed on the screen, etc.
    2023-08-11 06:25:03下载
    积分:1
  • 8051单片机的监控程序
    8051监控程序:-使用外部ram运行用户程序-使用EEPROM保存用户程序-提供单步去毛刺,可以读取内部寄存器和ram
    2022-08-22 01:20:44下载
    积分:1
  • keil c51教程 keil c51教程
    keil c51教程 keil c51教程-keil c51keil c51keil c51keil c51
    2023-08-06 10:15:04下载
    积分:1
  • Fortran插值程序
    Fortran插值程序,共有8个。 包括拉格朗日插值,spline插值,抛物线插值等。初学者必备。
    2022-03-17 07:04:45下载
    积分:1
  • 6. Electronic advertising (8X8) display, digital tube display 5 words
    6.电子广告(8X8)显示屏,数码管上显示5的字样-6. Electronic advertising (8X8) display, digital tube display 5 words
    2022-11-16 13:20:03下载
    积分:1
  • 对源代码的电磁波时域有限差分模拟
    一种实现电磁波的FDTD仿真模拟的源程序代码-An FDTD simulation of electromagnetic waves of the source code
    2022-07-08 22:13:43下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载