From 6f871859ab9f22fc4578ad382283c60fcbad4a8d Mon Sep 17 00:00:00 2001 From: rakesh Date: Tue, 26 Nov 2019 13:55:40 +0530 Subject: [PATCH] Database prorgam changes --- Automation/move.py | 17 +++++++++++++---- database/tempCodeRunnerFile.py | 30 +++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/Automation/move.py b/Automation/move.py index eef8852..e708805 100644 --- a/Automation/move.py +++ b/Automation/move.py @@ -1,8 +1,17 @@ import glob import os import shutil +import time + +source = 'e:/python' dest_dir = "C:/test" -for file in glob.glob('e:/python/*.mp4'): - print(file) - shutil.copy(file, dest_dir) - os.unlink(file) + +files = glob.glob(source+"/*.txt") + +# for file in files: +# print(file) +# shutil.copy(file, dest_dir) +# os.unlink(file) +while True: + print("Hello rakesh") + time.sleep(5) diff --git a/database/tempCodeRunnerFile.py b/database/tempCodeRunnerFile.py index f817927..c362053 100644 --- a/database/tempCodeRunnerFile.py +++ b/database/tempCodeRunnerFile.py @@ -1,2 +1,30 @@ +# ------------------------------------------------------------------------------- +# Name: module1 +# Purpose: +# +# Author: acer +# +# Created: 12-04-2018 +# Copyright: (c) acer 2018 +# Licence: +# ------------------------------------------------------------------------------- -t = PrettyTable(['ID', 'Question', 'A', 'B', 'C', \ No newline at end of file +import MySQLdb +from prettytable import PrettyTable +# Open database connection +db = MySQLdb.connect("localhost", "root", "", "binarynote") +cursor = db.cursor() +sql = "select * from question" +cursor.execute(sql) +results = cursor.fetchall() +t = PrettyTable(['ID', 'Question', 'A', 'B', 'C', 'D', + 'Ans', 'Exp', 'gid', 'sid', 'tid']) +for idr, question, a, b, c, d, ans, exp, gid, sid, tid in results: + #idr = record[0] + #name = record[1] + #fname = record[2] + #add = record[3] + t.add_row([idr, question, a, b, c, d, ans, exp, gid, sid, tid]) + # print(idr,name,fname,add,phone,email) +print(t) +db.close()