Added file Constantes.py
This commit is contained in:
parent
a1771f90e3
commit
07270fedbb
5
Proyecto2n/Recursos/Constantes.py
Normal file
5
Proyecto2n/Recursos/Constantes.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
puerto = 8889
|
||||||
|
user = "dani"
|
||||||
|
passwd = "pythonrules"
|
||||||
|
db = 'estadistica'
|
||||||
|
host = 'localhost'
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
from Proyecto2n.Recursos import barajacpie,barajacpiepalo
|
from Proyecto2n.Recursos import barajacpie,barajacpiepalo, Constantes
|
||||||
from Proyecto2n import mainqt
|
from Proyecto2n import mainqt
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
@ -19,7 +19,8 @@ class Barajac(QMainWindow):
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.conn = pymysql.connect(host="localhost", port=8889, user="root", passwd="", db="estadistica")
|
self.conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
self.cursor = self.conn.cursor()
|
self.cursor = self.conn.cursor()
|
||||||
except:
|
except:
|
||||||
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
@ -4,14 +4,15 @@ from Proyecto2n import mainqt
|
|||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
import pymysql
|
import pymysql
|
||||||
from Proyecto2n.Recursos import barajalpie
|
from Proyecto2n.Recursos import barajalpie, Constantes
|
||||||
|
|
||||||
class Barajal(QMainWindow):
|
class Barajal(QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
QMainWindow.__init__(self)
|
QMainWindow.__init__(self)
|
||||||
uic.loadUi("barajal.ui", self)
|
uic.loadUi("barajal.ui", self)
|
||||||
try:
|
try:
|
||||||
self.conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
self.conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
self.cursor = self.conn.cursor()
|
self.cursor = self.conn.cursor()
|
||||||
except:
|
except:
|
||||||
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
from Proyecto2n import mainqt
|
from Proyecto2n import mainqt
|
||||||
from Proyecto2n.Recursos import cubopie
|
from Proyecto2n.Recursos import cubopie, Constantes
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
import pymysql
|
import pymysql
|
||||||
@ -15,7 +15,7 @@ class Cubo(QMainWindow):
|
|||||||
self.btnlanza.clicked.connect(self.lanzadado)
|
self.btnlanza.clicked.connect(self.lanzadado)
|
||||||
self.btnhome.clicked.connect(self.home)
|
self.btnhome.clicked.connect(self.home)
|
||||||
try:
|
try:
|
||||||
self.conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
self.conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user, passwd=Constantes.passwd, db=Constantes.db)
|
||||||
self.cursor = self.conn.cursor()
|
self.cursor = self.conn.cursor()
|
||||||
except:
|
except:
|
||||||
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
from Proyecto2n import mainqt
|
from Proyecto2n import mainqt
|
||||||
from Proyecto2n.Recursos import dodepie
|
from Proyecto2n.Recursos import dodepie, Constantes
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
import pymysql
|
import pymysql
|
||||||
@ -11,7 +11,8 @@ class Dodecaedro(QMainWindow):
|
|||||||
QMainWindow.__init__(self)
|
QMainWindow.__init__(self)
|
||||||
uic.loadUi("dodecaedro.ui", self)
|
uic.loadUi("dodecaedro.ui", self)
|
||||||
try:
|
try:
|
||||||
self.conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
self.conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
self.cursor = self.conn.cursor()
|
self.cursor = self.conn.cursor()
|
||||||
except:
|
except:
|
||||||
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
from Proyecto2n import mainqt
|
from Proyecto2n import mainqt
|
||||||
from Proyecto2n.Recursos import icopie
|
from Proyecto2n.Recursos import icopie, Constantes
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
import pymysql
|
import pymysql
|
||||||
@ -11,7 +11,8 @@ class Icosaedro(QMainWindow):
|
|||||||
QMainWindow.__init__(self)
|
QMainWindow.__init__(self)
|
||||||
uic.loadUi("icosaedro.ui", self)
|
uic.loadUi("icosaedro.ui", self)
|
||||||
try:
|
try:
|
||||||
self.conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
self.conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
self.cursor = self.conn.cursor()
|
self.cursor = self.conn.cursor()
|
||||||
except:
|
except:
|
||||||
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
from Proyecto2n import mainqt
|
from Proyecto2n import mainqt
|
||||||
from Proyecto2n.Recursos import monedapie
|
from Proyecto2n.Recursos import monedapie, Constantes
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
import pymysql
|
import pymysql
|
||||||
@ -13,7 +13,8 @@ class Moneda(QMainWindow):
|
|||||||
self.btnlanza.clicked.connect(self.lanzadado)
|
self.btnlanza.clicked.connect(self.lanzadado)
|
||||||
self.btnhome.clicked.connect(self.home)
|
self.btnhome.clicked.connect(self.home)
|
||||||
try:
|
try:
|
||||||
self.conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
self.conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
self.cursor = self.conn.cursor()
|
self.cursor = self.conn.cursor()
|
||||||
except:
|
except:
|
||||||
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
print("No hay conexión a la base de datos, temporalmente las estadísticas globales estarán desactivadas")
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import pymysql
|
import pymysql
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
from Proyecto2n.Recursos import Constantes
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class queso():
|
class queso():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="", db="estadistica")
|
conn = pymysql.connect(host=Constantes.host, port=Constantes.puerto, user=Constantes.user,
|
||||||
|
passwd=Constantes.passwd, db=Constantes.db)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
|
|||||||
103
estadistica.sql
103
estadistica.sql
@ -1,103 +0,0 @@
|
|||||||
-- phpMyAdmin SQL Dump
|
|
||||||
-- version 4.7.4
|
|
||||||
-- https://www.phpmyadmin.net/
|
|
||||||
--
|
|
||||||
-- Servidor: 127.0.0.1
|
|
||||||
-- Tiempo de generación: 30-10-2017 a las 19:32:13
|
|
||||||
-- Versión del servidor: 10.1.26-MariaDB
|
|
||||||
-- Versión de PHP: 7.1.9
|
|
||||||
|
|
||||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
|
||||||
SET AUTOCOMMIT = 0;
|
|
||||||
START TRANSACTION;
|
|
||||||
SET time_zone = "+00:00";
|
|
||||||
|
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
||||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
||||||
/*!40101 SET NAMES utf8mb4 */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Base de datos: `estadistica`
|
|
||||||
--
|
|
||||||
CREATE DATABASE IF NOT EXISTS `estadistica` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
|
|
||||||
USE `estadistica`;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Estructura de tabla para la tabla `cartacorta`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `cartacorta`;
|
|
||||||
CREATE TABLE `cartacorta` (
|
|
||||||
`numero` smallint(6) NOT NULL,
|
|
||||||
`fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Estructura de tabla para la tabla `cartalarga`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `cartalarga`;
|
|
||||||
CREATE TABLE `cartalarga` (
|
|
||||||
`numero` smallint(6) NOT NULL,
|
|
||||||
`palo` smallint(6) NOT NULL,
|
|
||||||
`fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Estructura de tabla para la tabla `dado6`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `dado6`;
|
|
||||||
CREATE TABLE `dado6` (
|
|
||||||
`numero` smallint(6) NOT NULL,
|
|
||||||
`fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Estructura de tabla para la tabla `dado12`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `dado12`;
|
|
||||||
CREATE TABLE `dado12` (
|
|
||||||
`numero` smallint(6) NOT NULL,
|
|
||||||
`fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Estructura de tabla para la tabla `dado20`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `dado20`;
|
|
||||||
CREATE TABLE `dado20` (
|
|
||||||
`numero` smallint(6) NOT NULL,
|
|
||||||
`fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Estructura de tabla para la tabla `moneda`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `moneda`;
|
|
||||||
CREATE TABLE `moneda` (
|
|
||||||
`lado` varchar(6) NOT NULL,
|
|
||||||
`fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
||||||
Loading…
Reference in New Issue
Block a user