Category : sqlite

import os import sqlite3 from Globalization import diseases from Globalization import crimes from Globalization import global_bag_value class Release: def release_data(): global counter counter = 1 path, filename = os.path.split(os.path.abspath(__file__)) newPath = path + "database" conn = sqlite3.connect(newPath + ‘student.db’) c = conn.cursor() c.execute(”’CREATE TABLE IF NOT EXISTS year”’+str(counter)+”’ (Id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, ..

Read more

Below is the code: import pandas as pd, csv, sqlite3 con = sqlite3.connect("CleanData.db") cur = con.cursor() a_file = open("csv1.csv") rows = csv.reader(a_file) cur.executemany("""INSERT INTO EmpMaster(OID, Month, Year, EMP_CODE, LocationCode, FullName, DateOfPay, PaidDays, Basic, BasicArr, HRA, HRAArr, EducationAllowance, EducationAllowanceArr, PDA, PDAArr, FoodAllowance, FoodAllowanceArr, GrossPM, LTA, LTAArr, LeaveEncashment, OtherEarning, CarReimbursement, CarReimbursementArr, AttireReimbursement, AttireReimbursementArr, TelephoneReimbursement, TelephoneReimbursementArr, BooksandPeriodicals, BooksandPeriodicalsArr, ..

Read more

@app.route(‘/login’) def login(): return render_template("index1.html",data=liste) @app.route(‘/dashboard’, methods = [‘POST’, ‘GET’]) def log(): p = request.form[‘Pseudo’] user_check = cur.execute("SELECT * FROM pseudo WHERE user = ?", (p,)).fetchone() if user_check == None: cur.execute("INSERT INTO pseudo (user, score, win, coup) VALUES (?,?,?,?)", (p,0,0,0)) conn.commit() return render_template("index.html",data=liste,Pseudo = p) @app.route(‘/dashboard’, methods = [‘POST’, ‘GET’]) def dashboard(): return render_template("index.html",data=liste) Hello, ..

Read more

def dashboard(): p = request.form[‘Pseudo’] if cur.execute("SELECT * FROM pseudo WHERE user = ?", (p,)) == 0: cur.execute("INSERT INTO pseudo (user, score, win, coup) VALUES (?,?,?,?)", (p,0,0,0)) conn.commit() else: pass return render_template("index.html",data=liste, Pseudo = p) Hello, my program doesn’t display any error, it’s a project for classes and I’ve been stuck for several hours. However ..

Read more

i am making pointing system in discord.py. I am using sqlite3 database and i have following problem: async def solved(ctx, member : discord.Member): c.execute(f’SELECT name FROM math WHERE name = "{member.name}"’) checkname = c.fetchone() if checkname == member.name: c.execute(f"INSERT INTO math VALUES(‘{member.name}’, 40, ‘{ctx.guild.id}’)") await ctx.send("User is in database") c.execute(f"SELECT qula FROM math WHERE name ..

Read more