Apuntes Python
Apuntes Python
# script.py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<py-script>
def cambiar_texto(event):
elemento = document.getElementById("mensaje")
else:
# Inicializar evento
def inicializar():
boton = document.getElementById("cambiar")
if boton:
else:
inicializar()
</py-script>
</body>
</html>
f=open('datos1.txt','w')
r='Matemáticas\n'
f.write(r)
r='Física\n'
f.write(r)
r='Química\n'
f.write(r)
f.close()
while True:
try:
arch=open(nombre+'.txt','r')
except FileNotFoundError:
if crear=='1':
arch=open(nombre+'.txt','w')
else:
continue
break
"""
Spyder Editor
"""
while True:
try:
arch=open(nombre+'.txt','r')
linea=arch.readline()
linea=arch.readline()
linea=arch.readline()
linea=arch.readline()
print(linea)
arch.close()
except FileNotFoundError:
if crear=='1':
arch=open(nombre+'.txt','w')
else:
continue
break
"""
f=open('datos1.txt','r')
r=f.readline()
print(r)
r=f.readline()
print(r)
r=f.readline()
print(r)
r=f.readline()
print(r)
r=f.readline()
print(r)
r=f.readline()
print(r)
r=f.readline()
print(r)
f.close()
"""
"""
f=open('datos1.txt','w')
r='Matemáticas\n'
f.write(r)
r='Física\n'
f.write(r)
r='Química\n'
f.write(r)
r='Programación Básico\n'
f.write(r)
f.close()