Skip to content

Commit

Permalink
matplotlib explained
Browse files Browse the repository at this point in the history
  • Loading branch information
linrakesh committed May 21, 2020
2 parents b8b6db5 + 62b0535 commit a463ce0
Show file tree
Hide file tree
Showing 13 changed files with 393 additions and 54 deletions.
2 changes: 1 addition & 1 deletion age.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
print('What is your age?') # ask for their age
myAge = input()
print('You will be ' + str(int(myAge) + 1) + ' in a year.')
print('You will be ' + myAge *2 + ' in a year.')
7 changes: 7 additions & 0 deletions database/rowCount_fun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import MySQLdb
db = MySQLdb.connect('localhost', 'root', '', 'davschool')
cursor = db.cursor()
cursor.execute('select * from games;')
rows = cursor.rowcount
db.close()
print('Total number of records :',rows)
32 changes: 2 additions & 30 deletions database/tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,2 @@
# -------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: acer
#
# Created: 12-04-2018
# Copyright: (c) acer 2018
# Licence: <your licence>
# -------------------------------------------------------------------------------

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()
import mysql.connector
conn = mysql.connector.connect(host='localhost',database='davschool',user='root',password='')
6 changes: 6 additions & 0 deletions database/using_connector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import mysql.connector
conn = mysql.connector.connect(host='localhost',database='davschool',user='root',password='')
cursor = conn.cursor()
cursor.execute('insert into games values(4,"fun with python",1500)')
conn.close()
print('Record inserted successfully')
2 changes: 1 addition & 1 deletion fileHandling/Bulk_Image_Resizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def small(source,target,original):
dest = target + '\\' +original
with open(original, 'r+b') as f:
with Image.open(f) as image:
cover = resizeimage.resize_cover(image, [383, 119], validate=False)
cover = resizeimage.resize_cover(image, [300, 200], validate=False)
cover.save(dest, image.format)

def deleteFiles():
Expand Down
Loading

0 comments on commit a463ce0

Please sign in to comment.