python 简谈3
来源:互联网 发布:阅读杂志的软件 编辑:程序博客网 时间:2024/06/08 00:52
#1.input用法a_input=input()print('hello',a_input)#shift+tab函数描述#shift+函数注释####2.文件读取text='write'print(text)my_file=open('file1.txt','w')#以写入的方式打开文件my_file.write(text)my_file.close()with open('file2.txt','w') as f2:#清空文件,然后写入 f2.write(text)with open('file2.txt','a') as f2:#追加内容 f2.write(text)with open('file2.txt','r') as f2:#追加内容 content=f2.read() #content=f2.readline()读取一行内容 #content=f2.readlines()读取所有行内容存储到一个列表中 print(content)#有空行filename='file2.txt'with open(filename) as f: for line in f: print(line)#无空行
阅读全文
0 0
- python 简谈3
- python 2 & python 3
- Python 3 会害死 Python
- Python--python基础知识(3)
- Python简谈
- python(3)
- Python(3)
- python - 3
- python-3
- python 3
- python 2 和 python 3
- Python print 语句(Python 2 与 Python 3)
- Python 初学者 入门 应该学习 python 2 还是 python 3?
- 【python基础知识】python 2 与python 3 的差异
- Python编程 (Programming Python, 3rd Edition)
- 【Python开发web】(3) -- Python基础之一
- Python 3 与Python 2的区别
- Python 3 与Python 2的区别
- Python基础-多线程与Lock锁
- Python dwebsocket
- 如何在setting里面添加自己的值
- UML· 初号机
- ZOJ
- python 简谈3
- JAVA IO流简单梳理
- vscode 编写vue项目1
- Python基础-ThreadLocal
- PBOC标准流程 apdu交互指令
- keepalived实现服务高可用
- Oracle 12.2软件安装的过程中会建立Oracle Home User和相关的OS 组
- win10+Anconda 4.3.3 +python 3.6.3 安装tensorflow
- 兄弟连学python03--- 利润算法