Created
November 21, 2013 02:21
-
-
Save anonymous/7575065 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 | |
basededatos = MySQLdb.connect(host='localhost',passwd='1234',user='root', db = 'test' ) | |
cursor = basededatos.cursor() | |
id_proyecto = input ("ingrese id del proyecto:") | |
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 | |
`test`.`Proyecto` | |
( | |
id_proyecto, | |
Nombre, | |
responsable, | |
estado, | |
fecha_inicio, | |
historial | |
) | |
VALUES | |
('%s', "%s", '%s', '%s','%s', '%s'); | |
""" % ( | |
id_proyecto, | |
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