Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python mysqldb

import MySQLdb

db = MySQLdb.connect(db=dbname, host=dbhost, user=dbuser, passwd=dbpass)

cursor = db.cursor()
cursor.execute("SELECT NOW();")

d = cursor.fetchone()
print("Now: ", d[0])

db.close()
Comment

PREVIOUS NEXT
Code Example
Python :: register temporary table pyspark 
Python :: pil image to numpy array 
Python :: convert image to black and white python 
Python :: What happens when you use the built-in function any() on a list? 
Python :: df drop index 
Python :: generic type python 
Python :: how to convert img to gray python 
Python :: python check if string is number reges 
Python :: python string math 
Python :: pathlib path get directory of current file 
Python :: escape brackets in f string 
Python :: multiple functions tkinter 
Python :: pandas add two string columns 
Python :: all the positions of a letter occurrences in a string python 
Python :: pyttsx3 install 
Python :: python dataframe remove header 
Python :: start virtualenv 
Python :: python script header 
Python :: python multiply list 
Python :: clearing canvas tkinter 
Python :: python falsy values 
Python :: how to plot pie chart in python 
Python :: python sort dict by key 
Python :: how to add element at first position in array python 
Python :: remove idx of list python 
Python :: django check if queryset is empty 
Python :: program arguments python 
Python :: how to draw a rectangle in pygame 
Python :: pd count how many item occurs in another column 
Python :: how to practise python 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =