首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    python读取access文件并入库

    Python读取access文件时和读取Excel文件不是很一样,当然用的工具也不一样,在读取excel中的数据时用的是xlrd,而读取access文件时用的则是pypyodbc。 简要安装过程:1、首先要安装access驱动(AccessRuntime_x64_zh-cn.exe),以便于python连接;2、安装pypyodbc模块(pypyodbc-1.3.3.zip)。安装完之后就可以连接access数据库了。(连接access是在Windows下作的,个人感觉在Linux下读取不了access) 简要使用过程(程序):安装完成后,1、在python程序中导入pypyodbc模块,然后再连接access既可。因为access属于数据库,在读取access中的数据时,也要用到sql语句。 例子: #!/usr/bin/python # -*- coding: utf-8 -*- importsys import pypyodbc reload(sys) sys.setdefaultencoding('gbk')  #####gbk也可以换成utf—8,如果出现编码问题,这两个都可以试试 conn = pypyodbc.connect(u'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=' + filepath)  #### filepath是变量,access文件的绝对路径。注意:*.accdb一定要加上 cur.execute('select * from %s' % tablename)  ### tablename是变量,指的是access中的表名 list = cur.fetchall()  ####获取access中的数据

    02

    Nginx 性能调优

    NGINX is well known as a high performance load balancer, cache and web server, powering over 40% of the busiest websites in the world.  Most of the default NGINX and Linux settings work well for most use cases, but it can be necessary to do some tuning to achieve optimal performance.  This blog post will discuss some of the NGINX and Linux settings to consider when tuning a system.  There are many settings available, but for this post we will cover the few settings recommended for most users to consider adjusting.  The settings not covered in this post are ones that should only be considered by those with a deep understanding of NGINX and Linux, or after a recommendation by the NGINX support or professional services teams.  NGINX professional services has worked with some of the world’s busiest websites to tune NGINX to get the maximum level of performance and are available to work with any customer who needs to get the most out of their system.

    02
    领券