adding all files done so far

This commit is contained in:
2019-07-10 20:18:31 +01:00
parent 13c0e9cb4d
commit e3ac390e8b
76 changed files with 8644 additions and 0 deletions

19
learning/singletons/db.py Normal file
View File

@@ -0,0 +1,19 @@
import sys
import os
sys.path.append(os.getcwd()) # noqa E402
this = sys.modules[__name__]
print(this)
this.db_name = None
print(this.db_name)
def initialize_db(name):
if (this.db_name is None):
this.db_name = name
# db_name = "Local Variable"
else:
msg = f"Database is already initialized to {name}"
raise RuntimeError(msg.format(this.db_name))