PROGRAMMING

  MINTE9
REMEMBERS




Last update:   13-05-2022

Escape

Prevent XSS attacks with html escape.
 
import os
import csv
from html import escape

def get_data(dir):
    values = []
    for root, dirs, files in os.walk(dir):
        for name in files:
            path = os.path.join(root, name)
            if name.__contains__("csv"):
                data = list(csv.reader(open(path), delimiter=';'))
                    for v in data:
                        values.append(escape(v[2])) # Look Here
    return list(dict.fromkeys((values)))

Questions    


        A B C D E F
🔔
1/1