Created
November 16, 2013 01:17
-
-
Save anonymous/7494553 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() | |
id_proyecto = input ("Ingrese Id de proyecto: ") | |
nombre = raw_input ("Ingrese nombre: ") | |
responsable = raw_input ("Ingrese nombre del responsable: ") | |
fecha_inicio= input ("Ingrese fecha (fomarto y-m-d):") | |
estado= ("Ingrese el estado: ") | |
historial = ("Ingrese historial: ") | |
insert="""INSERT INTO `trabajo_practico`.`Proyecto` (`id_proyecto`, `Nombre`, "responsable", `estado`, "fecha_inicio" "historial") \ | |
VALUES (NULL, '%i', '%s', '%s, "%y-%m-%d", 's%');""""" % (id_proyecto, nombre, responsable, estado, fecha_inicio, historial) | |
cursor.execute(insert) | |
basededatos.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment