Spaces:
Sleeping
Sleeping
laxminarasimha6
commited on
Commit
•
2cb4244
1
Parent(s):
6e5a30a
Upload 5 files
Browse files- .env +1 -0
- main.py +16 -0
- requirements.txt +3 -0
- sql.py +34 -0
- student.db +0 -0
.env
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
GOOGLE_API_KEY = "AIzaSyAq4dZC1shBKa6MXkAjOP80seDZ0CAChYc"
|
main.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This is a sample Python script.
|
2 |
+
|
3 |
+
# Press Shift+F10 to execute it or replace it with your code.
|
4 |
+
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
|
5 |
+
|
6 |
+
|
7 |
+
def print_hi(name):
|
8 |
+
# Use a breakpoint in the code line below to debug your script.
|
9 |
+
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
|
10 |
+
|
11 |
+
|
12 |
+
# Press the green button in the gutter to run the script.
|
13 |
+
if __name__ == '__main__':
|
14 |
+
print_hi('PyCharm')
|
15 |
+
|
16 |
+
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
google-generativeai
|
3 |
+
python-dotenv
|
sql.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sqlite3
|
2 |
+
|
3 |
+
## Connectt to SQlite
|
4 |
+
connection=sqlite3.connect("student.db")
|
5 |
+
|
6 |
+
# Create a cursor object to insert record,create table
|
7 |
+
|
8 |
+
cursor=connection.cursor()
|
9 |
+
|
10 |
+
## create the table
|
11 |
+
table_info="""
|
12 |
+
Create table if not exists STUDENT(NAME VARCHAR(25),CLASS VARCHAR(25),
|
13 |
+
SECTION VARCHAR(25),MARKS INT);
|
14 |
+
|
15 |
+
"""
|
16 |
+
cursor.execute(table_info)
|
17 |
+
## Insert Some more records
|
18 |
+
|
19 |
+
cursor.execute('''Insert Into STUDENT values('Vijay','Data Science','A',90)''')
|
20 |
+
cursor.execute('''Insert Into STUDENT values('Vaish','Data Science','B',100)''')
|
21 |
+
cursor.execute('''Insert Into STUDENT values('Piyush','Data Science','A',86)''')
|
22 |
+
cursor.execute('''Insert Into STUDENT values('Anas','DEVOPS','A',50)''')
|
23 |
+
cursor.execute('''Insert Into STUDENT values('Rana','DEVOPS','A',35)''')
|
24 |
+
|
25 |
+
## Disspaly ALl the records
|
26 |
+
|
27 |
+
print("The isnerted records are")
|
28 |
+
data=cursor.execute('''Select * from STUDENT''')
|
29 |
+
for row in data:
|
30 |
+
print(row)
|
31 |
+
|
32 |
+
## Commit your changes int he databse
|
33 |
+
connection.commit()
|
34 |
+
connection.close()
|
student.db
ADDED
Binary file (8.19 kB). View file
|
|