会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132440个问题

代码已经把老师的复制过来运行了,结果还是报这个错误,问题出在了哪里

data01.xlsx

import xlrd
from xlutils.copy import copy

def read_data():
    wb = xlrd.open_workbook('data01.xlsx')
    sh = wb.sheet_by_index(0)
    fen_type = {}       # {a:110,b:300}
    count_price = []    # [1,2,3,4,5,6]

    for r in range(sh.nrows):
        count = sh.cell_value(r,3) * sh.cell_value(r,4)
        count_price.append(count)
        key = sh.cell_value(r,0)
        if fen_type.get(key):
            fen_type[key] += count
        else:
            fen_type[key] = count
    return fen_type,count_price # 各分类的总价值, 每个单品的总价值

def save(fen,count):
    wb = xlrd.open_workbook('data01.xlsx')
    sh_t = wb.sheet_by_index(0)
    wb2 = copy(wb)
    sh = wb2.get_sheet(0)
    for r in range(sh_t.nrows):
        sh.write(r,sh_t.ncols,count[r])
    
    sh2 = wb2.add_sheet('汇总的数据')
    for i,key in enumerate(fen.keys()):
        sh2.write(i,0,key)
        sh2.write(i,1,fen.get(key))
    wb2.save('05_汇总数据.xlsx')

if __name__ == "__main__":
    f,c = read_data()
    save(f,c)

151.png

Python 全系列/ 第十四阶段:自动化操作办公软件、邮件、定时任务等/自动化操作办公软件、邮件、定时任务等 19786楼
Python 全系列/第二阶段:Python 深入与提高/异常机制 19789楼
Java架构课程/第十六阶段:高并发与负载均衡/大型网站高并发处理 19791楼
Python 全系列/第一阶段:Python入门/函数和内存分析 19792楼

1653921337(1).jpg

servletdemo.rar

老师帮我看看

JAVA 全系列/第五阶段:JavaWeb开发/Servlet技术详解 19793楼

matplotlib01.rar

为什么字体还是没有显示出哎?

Python 全系列/第十八阶段:数据分析-数据可视化/matplotlib 19795楼

老师遇到状态码500的错误

canvas.png

package com.bjsxt.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;

public class respByteServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        /*图片载入*/
        File file=new File("d:/zhw.jpg");
        /*输出流*/
        FileInputStream fis=new FileInputStream("file");
        /*存入数组*/
        byte[] buff=new byte[fis.available()];
        fis.read(buff);/*读数据*/


        /*设置响应类型*/
        resp.setContentType("image/jpeg");
       /*用字节输出流*/
        OutputStream os=resp.getOutputStream();
        os.write(buff);/*写数据*/
        os.flush();
        os.close();
     }1
}
<servlet>
    <servlet-name>respByteServlet</servlet-name>
    <servlet-class>com.bjsxt.servlet.respByteServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>respByteServlet</servlet-name>
    <url-pattern>/byte.do</url-pattern>
</servlet-mapping>

老师麻烦指导一下。。

JAVA 全系列/第五阶段:JavaWeb开发/Servlet技术详解(旧) 19796楼

老师帮忙看看哪里出错了


Exception in thread "main" java.lang.ExceptionInInitializerError

 at com.bjsxt.test.SelectUsersByIdTest.main(SelectUsersByIdTest.java:10)

Caused by: org.apache.ibatis.exceptions.PersistenceException: 

### Error building SqlSession.

### The error may exist in SQL Mapper Configuration

### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.github.pagehelper.PageInterceptor'.  Cause: java.lang.ClassNotFoundException: Cannot find class: com.github.pagehelper.PageInterceptor

 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)

 at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)

 at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)

 at com.bjsxt.utils.MybatisUtils.<clinit>(MybatisUtils.java:22)

 ... 1 more

Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.github.pagehelper.PageInterceptor'.  Cause: java.lang.ClassNotFoundException: Cannot find class: com.github.pagehelper.PageInterceptor

 at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:122)

 at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:99)

 at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78)

 ... 3 more

Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.github.pagehelper.PageInterceptor'.  Cause: java.lang.ClassNotFoundException: Cannot find class: com.github.pagehelper.PageInterceptor

 at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuil


JAVA 全系列/第六阶段:项目管理与SSM框架/Mybatis 19798楼
JAVA 全系列/第十二阶段:Spring Cloud Alibaba技术栈/Zookeeper 19800楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637