Message from Python discussions
November 2018
— Not yet working
Import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="",
database="mydatabase"
)
mycursor = mydb.cursor()
sql = "INSERT INTO EMPLOYEE (FIRST_NAME,LAST_NAME,AGE,SEX,INCOME) VALUES (%s,%s)"
val = input("enter the FIRST_NAME")
vaa = input("enter the LAST_NAME")
mycursor.execute(sql,val,vaa)
mydb.commit()
print(mycursor.rowcount,"record inserted.")
mydb.close()
—
def com(text):
te = text.replace("!", ",")
one = te == text
two = te.startswith(text)
return one or two
def call(get):
if com(',test'):
get('this is testing')
am i wrong?
— Hii
— I need some help related to Python???
— Send channel link
— Is there any difference between "import some_module" and "from some_module import some_func"? I'm speaking in terms of memory usage. I suppose that in both cases we have to read the whole some_module.py. But what happens after? Unused elements of the module are to be removed from memory or they sit there in any case?
— Just the imported function will be loaded in the namespace
— Plus all global variables, plus all subfunctions it interacts with. I'm using psutil method process.memory_info().rss, but I see no difference between the two types of importing.
— A
— Use that link to learn faster.
— I dnt got u. There is no rule dont post gdrive link?
Those videos are just to learn