Skip to main content
Publicación cerrada como "Duplicada" por jachguate, fedorqui, Javi fer2
se añadieron 40 caracteres en el cuerpo; título editado
Origen Enlace
user128299
user128299

Error leyendo archivos python 3.9.4 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position

def read(): numbers = [] with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: for line in f: numbers.append(int(line)) print(numbers)

def run(): write()

if name == 'main': run()

def read():
    numbers = []
    with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f:
            for line in f:
            numbers.append(int(line))
    print(numbers)

def run():
    write()

if __name__ == '__main__':
    run()

File "C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\archivos.py", line 3 with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: consigo ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Error leyendo archivos python 3.9.4

def read(): numbers = [] with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: for line in f: numbers.append(int(line)) print(numbers)

def run(): write()

if name == 'main': run()

File "C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\archivos.py", line 3 with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: consigo ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position

def read():
    numbers = []
    with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f:
            for line in f:
            numbers.append(int(line))
    print(numbers)

def run():
    write()

if __name__ == '__main__':
    run()

File "C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\archivos.py", line 3 with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: consigo ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Origen Enlace

Error leyendo archivos python 3.9.4

def read(): numbers = [] with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: for line in f: numbers.append(int(line)) print(numbers)

def run(): write()

if name == 'main': run()

File "C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\archivos.py", line 3 with open("C:\Users\coder\Documents\Programacion\python_intermedio\clase_ambiente\numbers.txt", "r") as f: consigo ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape