Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls.__instance = super(MysqlPython, cls).__new__(cls,*args,**kwargs)
- TypeError: object() takes no parameters
- from classes.mysql_python import MysqlPython
- connect_mysql = MysqlPython('127.0.0.1', 'root', '', 'bio')
- exit()
- import MySQLdb, sys
- from collections import OrderedDict
- class MysqlPython(object):
- """
- Python Class for connecting with MySQL server and accelerate development project using MySQL
- Extremely easy to learn and use, friendly construction."""
- __instance = None
- __host = None
- __user = None
- __password = None
- __database = None
- __session = None
- __connection = None
- def __new__(cls, *args, **kwargs):
- if not cls.__instance or not cls.__database:
- cls.__instance = super(MysqlPython, cls).__new__(cls,*args,**kwargs)
- return cls.__instance
- ## End def __new__
- def __init__(self, host='localhost', user='root', password='', database=''):
- self.__host = host
- self.__user = user
- self.__password = password
- self.__database = database
- ## End def __init__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement