Skip to content

Commit

Permalink
Database prorgam changes
Browse files Browse the repository at this point in the history
  • Loading branch information
linrakesh committed Nov 26, 2019
1 parent 68b0c7d commit 6f87185
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
17 changes: 13 additions & 4 deletions Automation/move.py
Original file line number Diff line number Diff line change
@@ -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)
30 changes: 29 additions & 1 deletion database/tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# -------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: acer
#
# Created: 12-04-2018
# Copyright: (c) acer 2018
# Licence: <your licence>
# -------------------------------------------------------------------------------

t = PrettyTable(['ID', 'Question', 'A', 'B', 'C',
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()

0 comments on commit 6f87185

Please sign in to comment.