[python] read file
来源:互联网 发布:netkeeper for linux 编辑:程序博客网 时间:2024/06/06 07:50
read a txt file and remove \n
and punctuations
des_path="event_description/"for i in range(21,41): des_txt = "%s/E0%d.txt" %(des_path, i) with open(des_txt, 'r') as f: data = f.read() # .replace('\n', '') words = data.split() print(words) for i in words: print(i.translate(None, string.punctuation).lower()) ''' i = i.replace('(','') i = i.replace(')','') i = i.replace('[','') i = i.replace(']','') i = i.replace(',','') print(i) '''
阅读全文
0 0
- python read write file
- python read file
- Read File in Python
- [python] read file
- Python file read and wirte
- python read file(f,csv)
- python read xml file--simple example
- python-read the file contains Chinese
- python exercise 15 read a file
- python.pandas read and write CSV file
- File Read
- read file
- file operate in python (open write read close )
- Read .properties file
- Read .XML file
- db file sequential read
- Read cvs file
- Read Resource File
- maven安装和配置
- solr下载安装启动(直接启动)
- C语言scanf()和gets()及printf()和puts()的区别
- 连接
- Android Studio导入AngEngine
- [python] read file
- win8.1怎样创建ftp服务器
- 使用AsynchttpClient下载文件,以文件流的形式的方法
- 数据的表现形式及其输入输出
- 花生壳原理(DDNS)动态域名解析
- 二叉树的性质
- DIV居中的方式,适合新手。
- Android Studio:基本UI界面设计 (详细)
- 1、spring boot之Hello world