Category : syntax

I have code that bulk inserts a csv file into. This is my MySQL code: SET GLOBAL local_infile=TRUE; LOAD DATA LOCAL INFILE ‘C://Users//User//Documents//CIS3365//CSV//Student Info.csv’ INTO TABLE CIS3365.Students FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘"’ LINES TERMINATED BY ‘n’ IGNORE 1 ROWS; When I insert it into a query using MySQL Workbench 8.0, it works just ..

Read more

I’m getting errors while declaring a global variable. I defined a global variable inside a definition. import os import time as t s = t.time() import numpy as np #print(os.getcwd()) #print(os.listdir(os.getcwd())) chDir = os.chdir("/storage/emulated/0/OS-TEST-FOLDER") print(chDir) #print(dir(os)) file = open("Times.txt",’w’) tann = [] def tanns(): while True: epochs = int(input("Enter how many epochs please >>> ")) ..

Read more

@pyqtSlot() def on_click(self): file_name = QFileDialog.getOpenFileName(self, ‘Open File’, ‘c:’, ‘Image Files (*.png *.jpg *gif)’) image_path = file_name[0] self.converttobinary(image_path) def converttobinary(self, filename): with open(filename, ‘rb’) as file: binarydata = file.read() mycursor.execute("INSERT INTO imagestore (imgg) VALUES(%s)" % (binarydata)) mydb.commit() print("image file inserted succesfully") this a sample of my code, i keep getting: mysql.connector.errors.ProgrammingError: 1064 (42000): You have ..

Read more