Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pytonh leer txt y quitar tildes acentos

import sys 
reload(sys) 
sys.setdefaultencoding("utf-8")
import csv
import unicodedata

def remove_accents(input_str):
    nkfd_form = unicodedata.normalize('NFKD', unicode(input_str))
    return u"".join([c for c in nkfd_form if not unicodedata.combining(c)])

with open('test.txt') as f:
    read = csv.reader(f)
    for row in read:
        for element in row:
            print remove_accents(element)
Comment

PREVIOUS NEXT
Code Example
Python :: insta bs2json 
Python :: select dropdown lilst item in selenium 4 python 
Python :: How To Let Your Main Window Appear after succesful login in Tkinter 
Python :: how to make a random question generator in python 
Python :: heading none in pandas import 
Python :: Get percentage of missing values pyspark all columns 
Python :: os.path.dirname(__file__) 
Python :: python remove (string) 
Python :: gunicorn django static files 
Python :: Using emoji Modules in Python 
Python :: jupyterthemes jplot 
Python :: pickle.load from gpu device to cpu 
Python :: Python Import all names 
Python :: python list sort key lambda on equal other function 
Python :: python remove vowels from string 
Python :: why python stops after plt.show() 
Python :: pandas options 
Python :: pythonhashseed 
Python :: int to byte array python 
Python :: how to skip error python 
Python :: message to dict protobuf 
Python :: Anderson-Darling test in python 
Python :: python json change line 
Python :: pandas data frame from part of excel better example 
Python :: how to send image to template thats not in static flask 
Python :: getting-the-last-element-of-a-list 
Python :: Flatten List in Python With Itertools 
Python :: to_datetime with non zero padded values python 
Python :: python utf upper() 
Python :: how to allow a range of numbers for example 1 to 14 on regular expression python 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =