-
-
Save ricardosiri68/7494601 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MySQLdb | |
import datetime | |
basededatos = MySQLdb.connect(host='localhost',passwd='1234',user='root', db = 'trabajo_practico' ) | |
cursor = basededatos.cursor() | |
nombre = raw_input ("Ingrese nombre: ") | |
responsable = raw_input ("Ingrese nombre del responsable: ") | |
fecha_inicio= input ("Ingrese fecha (fomarto y-m-d):") | |
estado= raw_input("Ingrese el estado: ") | |
historial = raw_input("Ingrese historial: ") | |
insert=""" | |
INSERT INTO | |
`trabajo_practico`.`Proyecto` | |
( | |
Nombre, | |
responsable, | |
estado, | |
fecha_inicio, | |
historial | |
) | |
VALUES | |
('%s', '%s', '%s','%s', '%s'); | |
""" % ( | |
nombre, | |
responsable, | |
estado, | |
fecha_inicio, | |
historial | |
) | |
cursor.execute(insert) | |
basededatos.commit() | |
basededatos.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment