会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132602个问题
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Flask之Jinja2模版 27137楼
JAVA 全系列/第三阶段:数据库编程/JDBC技术(旧) 27139楼
Python 全系列/第十九阶段:数据分析-数据管理/numpy 27140楼

问题:无法读取schema文档。

说明:老师,我的xml文件和xsd文件都是按照视频里讲述的编写的,两个文件也都放在了项目根目录下,但是在引入xsd文件的时候仍然报错。我的文件按照视频写过好几个版本了,文件位置也放到src目录下试过,都没有解决。烦请帮忙给解答一下,谢谢。

系统错误信息:

图片.png


图片.png


文件内容:

1、book.xml

<?xml version="1.0" encoding="UTF-8"?>
<books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="{book.xsd}">
    <book id="1001">
        <name>一路向北</name>
        <author>一路</author>
        <price>98.6</price>
    </book>
    <book>
        <name>未来可期</name>
        <author>不告诉你</author>
        <price>99.9</price>
    </book>
</books>

2、book.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="books">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="book" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="name" type="xs:string"></xs:element>
                            <xs:element name="author" type="xs:string"></xs:element>
                            <xs:element name="price" type="xs:double"></xs:element>
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:positiveInteger"></xs:attribute>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>


JAVA 全系列/第二阶段:JAVA 基础深化和提高/XML 技术(旧) 27141楼
JAVA 全系列/第五阶段:JavaWeb开发/Servlet技术详解(旧) 27142楼

Microsoft Windows [版本 10.0.18363.1198]
(c) 2019 Microsoft Corporation。保留所有权利。

F:\百战python\代码\GUI图形>pyinstaller -F pen.py
'pyinstaller' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Microsoft Windows [版本 10.0.18363.1198]
(c) 2019 Microsoft Corporation。保留所有权利。

F:\百战python\代码\GUI图形>pyinstaller -F pen.py
80 INFO: PyInstaller: 4.1
81 INFO: Python: 3.7.8
82 INFO: Platform: Windows-10-10.0.18362-SP0
83 INFO: wrote F:\百战python\代码\GUI图形\pen.spec
85 INFO: UPX is not available.
88 INFO: Extending PYTHONPATH with paths
['F:\\百战python\\代码\\GUI图形', 'F:\\百战python\\代码\\GUI图形']
110 INFO: checking Analysis
110 INFO: Building Analysis because Analysis-00.toc is non existent
110 INFO: Initializing module dependency graph...
113 INFO: Caching module graph hooks...
125 INFO: Analyzing base_library.zip ...
2886 INFO: Processing pre-find module path hook distutils from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2887 INFO: distutils: retargeting to non-venv dir 'f:\\软件\\python\\lib'
5509 INFO: Caching module dependency graph...
5608 INFO: running Analysis Analysis-00.toc
5612 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by f:\软件\python\python.exe
5685 INFO: Analyzing F:\百战python\代码\GUI图形\pen.py
5896 INFO: Processing module hooks...
5896 INFO: Loading module hook 'hook-difflib.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5897 INFO: Excluding import of doctest from module difflib
5898 INFO: Loading module hook 'hook-distutils.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5899 INFO: Loading module hook 'hook-encodings.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5984 INFO: Loading module hook 'hook-heapq.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5986 INFO: Excluding import of doctest from module heapq
5986 INFO: Loading module hook 'hook-pickle.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5987 INFO: Excluding import of argparse from module pickle
5987 INFO: Loading module hook 'hook-sysconfig.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
5988 INFO: Loading module hook 'hook-xml.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
6324 INFO: Loading module hook 'hook-_tkinter.py' from 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks'...
6468 INFO: checking Tree
6468 INFO: Building Tree because Tree-00.toc is non existent
6468 INFO: Building Tree Tree-00.toc
6537 INFO: checking Tree
6537 INFO: Building Tree because Tree-01.toc is non existent
6543 INFO: Building Tree Tree-01.toc
6620 INFO: checking Tree
6620 INFO: Building Tree because Tree-02.toc is non existent
6622 INFO: Building Tree Tree-02.toc
6642 INFO: Looking for ctypes DLLs
6642 INFO: Analyzing run-time hooks ...
6646 INFO: Including run-time hook 'f:\\软件\\python\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
6651 INFO: Looking for dynamic libraries
6918 INFO: Looking for eggs
6918 INFO: Using Python library f:\软件\python\python37.dll
6924 INFO: Found binding redirects:
[]
6928 INFO: Warnings written to F:\百战python\代码\GUI图形\build\pen\warn-pen.txt
6964 INFO: Graph cross-reference written to F:\百战python\代码\GUI图形\build\pen\xref-pen.html
7001 INFO: checking PYZ
7001 INFO: Building PYZ because PYZ-00.toc is non existent
7002 INFO: Building PYZ (ZlibArchive) F:\百战python\代码\GUI图形\build\pen\PYZ-00.pyz
7591 INFO: Building PYZ (ZlibArchive) F:\百战python\代码\GUI图形\build\pen\PYZ-00.pyz completed successfully.
7600 INFO: checking PKG
7601 INFO: Building PKG because PKG-00.toc is non existent
7601 INFO: Building PKG (CArchive) PKG-00.pkg
14587 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
14615 INFO: Bootloader f:\软件\python\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
14616 INFO: checking EXE
14617 INFO: Building EXE because EXE-00.toc is non existent
14618 INFO: Building EXE from EXE-00.toc
14619 INFO: Appending archive to EXE F:\百战python\代码\GUI图形\dist\pen.exe
14631 INFO: Building EXE from EXE-00.toc completed successfully.

image.png


老师,我想问一下,打包成exe文件这个过程,我在pycharm中提示我不是内部命令,但我在cmd里就能打包是怎么回事?

Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 27146楼
JAVA 全系列/第十三阶段:分布式文件存储与数据缓存/Nginx 27147楼
JAVA 全系列/第十三阶段:分布式文件存储与数据缓存/Nginx 27148楼
JAVA 全系列/第十三阶段:分布式文件存储与数据缓存/Nginx 27149楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>html事件</title>
    <style>
        .div1 {
            width: 200px;
            height: 200px;
            background-color: paleturquoise;
        }
        .div2 {
            margin: 25px auto;
            width: 100px;
            height: 100px;
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="div1" onclick="text1()">div1
        <div class="div2" onclick="text3(); text2()">div2</div>
    </div>
<script>
    var div1=document.querySelector('.div1');
    var div2=document.querySelector('.div2');
    function text1() {
        console.log('这是第一个函数');
    }
    function text2() {
        div2.setAttribute('onclick',null);
        console.log('这是第二个函数');
    }
    function text3() {
        div2.setAttribute('onclick',null);
        console.log('这是第三个函数');
    }
    // div2.setAttribute('onclick',null);
</script>
</body>
</html>

问题一:我在函数里面写了事件移除的代码,为啥点击div2还是执行了代码?

问题二,既然我们要删除事件了,为啥代码不写在外面呢?就像最后一行注释的代码。

QQ截图20201208222729.png


WEB前端全系列/第二阶段:JavaScript编程模块/浏览器模型(BOM) 27150楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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