简体   繁体   中英

python mysqldb printing text even if no print statement in the code

This is my program

import MySQLdb as mdb

from MySQLdb import IntegrityError

conn = mdb.connect("localhost", "asdf", "asdf", "asdf")

when the connect function is called python prints some text ("h" in the shell). This happens only if I execute the script file from a particular folder. If I copy the same script file to some other folder "h" is not printed.

actually i had this line previously in the same script for testing

print "h"

but now i have removed the line from the script. But still it is printed. What happen to my folder?

Try deleting *.pyc files. Secondly use script with -v option so that you can view from where the file is being imported

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM