当前位置: 首页 > news >正文

织梦网站怎么居中网站建设图片像素是多大的

织梦网站怎么居中,网站建设图片像素是多大的,wordpress制作的网页,建设展示类网站的意义本文为博主原创#xff0c;未经授权#xff0c;严禁转载及使用。 本文链接#xff1a;https://blog.csdn.net/zyooooxie/article/details/124640412 之前写了篇 Python脚本之连接MySQL【三】#xff0c;日常使用过程中#xff0c;代码实际有很多改动#xff0c;特此更新…本文为博主原创未经授权严禁转载及使用。 本文链接https://blog.csdn.net/zyooooxie/article/details/124640412 之前写了篇 Python脚本之连接MySQL【三】日常使用过程中代码实际有很多改动特此更新 【实际这篇博客推迟发布N个月】 个人博客https://blog.csdn.net/zyooooxie 【以下所有内容仅为个人项目经历如有不同纯属正常】 Cursor类的nextset()、_nextset() https://peps.python.org/pep-0249/#nextset Cursor.nextset()This method will make the cursor skip to the next available set, discarding any remaining rows from the current set.If there are no more sets, the method returns None. Otherwise, it returns a true value and subsequent calls to the .fetch*() methods will return rows from the next result set.方法优化【2】 【读取ini配置文件 建立、关闭数据库连接】 filename: db.ini [zyooooxie_db] user user_zy host host_zy passwd passwd_zy database database_zyblog: https://blog.csdn.net/zyooooxie qq: 153132336 email: zyooooxiegmail.com from pymysql.connections import Connection from pymysql.cursors import Cursor from pymysql.constants import CLIENTdef read_ini(ini_path: str db.ini):读取配置文件:param ini_path:默认是数据库的配置文件:return:if os.path.isfile(ini_path):config ConfigParser()config.read(ini_path, encodingUTF-8)return {cf: config.items(cf) for cf in config.sections()}def connect_db(db_name: str) - (Connection, Cursor):建立链接传参为 具体的db:param db_name::return:ini_dict read_ini()if db_name in ini_dict:res_list ini_dict.get(db_name)res_dict dict(res_list)else:raise Exception(传参不合法)db pymysql.connect(port3306, charsetutf8, autocommitTrue, client_flagCLIENT.MULTI_STATEMENTS,use_unicodeTrue, **res_dict) # client_flag传值默认可以同时执行多条sql语句的cur db.cursor()Log.debug({} connect.format(db_name))return db, curdef close_db(db: Connection, cur: Cursor):断开连接:param db::param cur::return:cur.close()db.close()Log.debug(connect close) exe_sql()、fetch_sql()、fetch_sqls() blog: https://blog.csdn.net/zyooooxie qq: 153132336 email: zyooooxiegmail.com def exe_sqls(sql: str, db_name: str, db: Connection None, cur: Cursor None):多条sql语句-execute():param sql::param db_name::param db::param cur::return:exe_sql(sqlsql, db_namedb_name, dbdb, curcur)def exe_sql(sql: str, db_name: str, exe_mode: str None, data_list: list or tuple None,db: Connection None, cur: Cursor None):1条sql语句-execute()、executemany():param sql::param db_name::param exe_mode::param data_list::param db::param cur::return:if not bool(cur):db_use, cur_use connect_db(db_namedb_name)else:db_use, cur_use db, curLog.info(sql)if data_list is None and exe_mode is None:try_str cur_use.execute(sql)elif exe_mode execute and data_list is not None:assert sql.find((%s) ! -1try_str cur_use.execute(sql, data_list)elif exe_mode executemany and data_list is not None:assert sql.find((%s) ! -1try_str cur_use.executemany(sql, data_list)else:Log.error({}--{}.format(exe_mode, data_list))raise Exception(Execute Error)try:result eval(try_str, locals())except Exception as e:db_use.rollback()Log.error(e.args)Log.info(traceback.format_exc())result FalseLog.error(sql执行有问题)else:execute_sql_result_check(result)finally:if not bool(cur):close_db(dbdb_use, curcur_use)def execute_sql_result_check(result):SQL Execute结果检查:param result::return:if not result:Log.error({}-Number of affected rows.format(result))else:Log.debug(Execute Succeed:{}.format(result))def fetch_sqls(sql: str, db_name: str, db: Connection None, cur: Cursor None) - List[tuple]:多条sql语句-fetchall():param sql::param db_name::param db::param cur::return:if not bool(cur):db_use, cur_use connect_db(db_namedb_name)else:db_use, cur_use db, curLog.info(sql)try:data list()cur_use.execute(sql)data.append(cur_use.fetchall())# while True:## if cur_use.nextset():# data.append(cur_use.fetchall())## else:# breakwhile cur_use.nextset():data.append(cur_use.fetchall())except Exception as e:db_use.rollback()Log.debug(e.args)Log.info(traceback.format_exc())data FalseLog.error(sql执行有问题)else:for d in data:fetch_sql_result_check(d)finally:if not bool(cur):close_db(dbdb_use, curcur_use)return datadef fetch_sql(sql: str, db_name: str, fetch_mode: str fetchall, db: Connection None, cur: Cursor None):1条sql语句-fetchone()、fetchall():param sql::param db_name::param fetch_mode::param db::param cur::return:if not bool(cur):db_use, cur_use connect_db(db_namedb_name)else:db_use, cur_use db, curLog.info(sql)if fetch_mode fetchall:try_str cur_use.fetchall()elif fetch_mode fetchone: # 很少用到try_str cur_use.fetchone()else:Log.error(fetch_mode: {}.format(fetch_mode))raise Exception(fetch_mode)try:cur_use.execute(sql)data eval(try_str, locals())except Exception as e:db_use.rollback()Log.debug(e.args)Log.info(traceback.format_exc())data FalseLog.error(sql执行有问题)else:fetch_sql_result_check(data)finally:if not bool(cur):close_db(dbdb_use, curcur_use)return datadef fetch_sql_result_check(result):SQL Fetch结果检查:param result::return:if not result:Log.error({}-Fetch Nothing.format(result))else:Log.debug(Fetch Succeed) 实际应用【2】 blog: https://blog.csdn.net/zyooooxie qq: 153132336 email: zyooooxiegmail.com def test_0801():from XXX_use.common_mysql import fetch_sql, connect_db, close_db, fetch_sqls, exe_sql, exe_sqlsdb_, cur_ connect_db(db_namezy_db)sql SELECT * FROM table_c_r ORDER BY update_date DESC ;data fetch_sql(sqlsql, db_namezy_db, fetch_modefetchall, dbdb_, curcur_)Log.info(data)data fetch_sql(sqlsql, db_namezy_db, fetch_modefetchone, dbdb_, curcur_)Log.info(data)data fetch_sql(sqlsql, db_namezy_db, dbdb_, curcur_)Log.info(data)sql SELECT * FROM table_c_r_g_m_s ORDER BY update_date DESC LIMIT 50 ;# 这条sql查不到数据SELECT * FROM table_c_b_r_r WHERE delete_flag 1 ORDER BY update_date DESC ; SELECT * FROM table_c_r ORDER BY update_date DESC LIMIT 1;res fetch_sqls(sqlsql, db_namezy_db, dbdb_, curcur_)Log.info(res)data_list [(TEST0801 ZYOOOOXIE_ str(i), Name str(i), zyooooxie) for i inrandom.sample(range(500), 10)]Log.info(data_list)sql insert into table_c_g_c (c_i, name, owner) VALUES (%s, %s, %s);exe_sql(sqlsql, db_namezy_db, exe_modeexecutemany, data_listdata_list, dbdb_, curcur_)exe_sql(sqlsql, db_namezy_db, exe_modeexecute, data_listdata_list[-1], dbdb_, curcur_)sql insert into table_c_g_c (c_i, name, owner) VALUES (TEST0801ZYOOOOXIE_11,Name_11, zyooooxie) ; insert into table_c_y_a (username, password)values (TEST0801_11, pwd_11);insert into table_c_g_c (c_i, name, owner) VALUES (TEST0801ZYOOOOXIE_12,Name_12, zyooooxie) ; exe_sql(sqlsql, db_namezy_db, dbdb_, curcur_)exe_sqls(sqlsql, db_namezy_db, dbdb_, curcur_)sql_ DELETE FROM table_c_g_c WHERE c_i LIKE TEST0801% ;DELETE FROM table_c_y_a WHERE username LIKE TEST0801% ;DELETE FROM table_c_y_a WHERE username LIKE TEST080808% ;exe_sql(sqlsql_, db_namezy_db, dbdb_, curcur_)exe_sqls(sqlsql_, db_namezy_db, dbdb_, curcur_)close_db(db_, cur_) 本文链接https://blog.csdn.net/zyooooxie/article/details/124640412 个人博客 https://blog.csdn.net/zyooooxie
http://www.zqtcl.cn/news/786154/

相关文章:

  • c++可以做网站吗极验 wordpress 表单
  • 电脑做系统都是英文选哪个网站找外贸客户的联系方式软件
  • 商城网站建设咨询建工社官网
  • 国土资源局网站建设制度蓝牙 技术支持 东莞网站建设
  • 12380网站建设建议上海网站推广服务
  • 做公司网站要提供什么企业门户app
  • 免费企业网站模板 php网站301跳转怎么做
  • 沭阳哪里有做网站推广的二手车网站源码下载
  • 网站建设添加视频教程wordpress做阿里巴巴国际站
  • 四川网站建设哪家专业辽宁招投标工程信息网
  • 小语种网站建设wordpress 上传图片不显示
  • 建网站什么网最好重庆制作网站公司简介
  • 中国建站平台邯郸现代建设集团网站
  • 爱站seo排名可以做哪些网站宁波网站怎么建设
  • 洛阳市伊滨区建设局网站企业集团网站源码
  • 做修图网站电脑配置wordpress后台登录页面美化
  • 中国十大物联网公司广州网站快速排名优化
  • 发帖网站有哪些wordpress提请审批
  • 网页设计网站导航怎么弄红色字体的内蒙古住房与建设厅网站
  • 微信网站什么做百度官网认证
  • 怎么提升网站流量做五金建材市场的网站
  • 网站合作流程h5网站怎么做api对接
  • asp.net 网站 结构手机客户端网站建设
  • 图片网站怎么做SEO参与网站建设注意
  • 网站界面设计案例教程wordpress更新报错
  • Dw做网站怎么加logo如何申请小程序店铺
  • 官方网站下载官方版本wordpress文字可以动的插件
  • 企业网站模板 免费下载网站建设服务采购方案模板下载
  • 在万网申请的域名_需要把万网的账户密码给做网站的吗做鱫视频网站
  • 网站建设360wordpress 音乐下载主题