AdvPython Journal 35
AdvPython Journal 35
AdvPython Journal 35
Certificate
Date
Sr.
Index Date Sign
No.
Write a program to Python program to
1 implement various file operations.
Write a Program to demonstrate concept of
2 threading and multitasking in Python.
Write a Python Program to work with
databases in Python to perform operations
such as
3 a. Connecting to database
b. Creating and dropping tables
c. Inserting and updating into
tables.
Write a Python Program to demonstrate
4
different types of exception handing.
Write a GUI Program in Python to design
application that demonstrates
5 a. Different fonts and colours
b. Different Layout Managers
c. Event Handling
Write Python Program to create application
6 which uses date and time in Python.
Write a program to Python program to
implement concepts of OOP such as
7 a. Types of Methods
b. Inheritance
c. Polymorphism
Write a program to Python program to
implement concepts of OOP such as
8 a. Abstract methods and classes
b. Interfaces
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
3.2) Creating
and dropping
table Code:
import pymysql
db = pymysql.connect("localhost","root","12345","mydb") cursor
= db.cursor()
cursor.execute("DROP TABLE IF EXISTS STUD")
cursor.execute("CREATE TABLE STUD(NAME VARCHAR(20),AGE INT, SEX
CHAR(1),INCOME FLOAT)") db.close
3.3) Inserting
data Code:
import pymysql
db = pymysql.connect("localhost","root","12345","mydb")
cursor = db.cursor() try:
cursor.execute("INSERT INTO STUD VALUES ("RAM",18,"M",19868");)
db.commit()
except:
db.rollback()
db.close 3.4) Updating
data Code:
import pymysql
db = pymysql.connect("localhost","root","12345","mydb")
cursor = db.cursor() try:
cursor.execute("UPDATE STUD NAME="JARLISSON" WHERE INCOME=19868");)
db.commit() except:
db.rollback() db.close
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
Output:
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
6.Write Python Program to create application which uses date and time in
Python.
Code:
import datetime now =
datetime.datetime.now()
print ("Current date and time : ") print
(now.strftime("%Y-%m-%d %H:%M:%S")) Output:
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
self.showData()
print("Hospital: ", self.__hospital)
print("Department: ", self.__dept) e=Employee()
e.setEmployee(1,"Prem Sharma","Male","gmr","excavation")
e.showEmployee()
print("\n") d =
Doctor()
d.setEmployee(1, "pankaj", "male", "aiims", "eyes")
d.showEmployee() Output:
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)
2
Satish Pradhan Dnyanasadhana College, Thane [ A. Y. 2021 – 2022]
Name: Ayush Madheshiya Roll No.: 108
Program: FY B.Sc. CS (sem II) Subject: Advance Python (PR)