linux pybind11 python c++ 混合编程(包括具体版本匹配的设置)

news2024/12/20 7:14:24

pybind11的处理过程

        我首先安装了pybind,参考了许多教程,但很多教程的貌似都来自微软导出pyd的方法,但是实际上linux下导出so文件而非pyd文件,后续运行的实例来自https://github.com/tdegeus/pybind11_examples(代码就不再本文中介绍了),因为python版本问题一直无法成功运行,所以我按照github的结构重新配置了文件(即下载pybind11源文件到当前目录,使用非安装方式,而无需再Cmakelists里进行任何修改),但仍然无法正常运行。后来看有说是python版本问题导致能够导出so却无法运行,所以后续就尝试了几种更改python版本的方式,运行成功。

pybind 安装

get

(base) pdd@pdd-Dell-G15-5511:~/CLionProjects$ git clone https://github.com/pybind/pybind11
正克隆到 'pybind11'...
remote: Enumerating objects: 25971, done.
remote: Counting objects: 100% (183/183), done.
remote: Compressing objects: 100% (113/113), done.
remote: Total 25971 (delta 80), reused 117 (delta 62), pack-reused 25788
接收对象中: 100% (25971/25971), 10.04 MiB | 739.00 KiB/s, 完成.
处理 delta 中: 100% (18198/18198), 完成.

make

(base) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11$ mkdir build && cd build && cmake ..
-- The CXX compiler identification is GNU 9.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 v2.11.0 dev1
-- CMake 3.22.1
-- Found PythonInterp: /home/pdd/anaconda3/bin/python (found suitable version "3.9.13", minimum required is "3.6") 
-- Found PythonLibs: /home/pdd/anaconda3/lib/libpython3.9.so
-- PYTHON 3.9.13
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- pybind11::lto enabled
-- pybind11::thin_lto enabled
-- Setting tests build type to MinSizeRel as none was specified
-- Building tests WITHOUT Eigen, use -DDOWNLOAD_EIGEN=ON on CMake 3.11+ to download
-- Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version "1.56")
-- Found pytest 7.1.2
-- Catch not detected. Interpreter tests will be skipped. Install Catch headers manually or use `cmake -DDOWNLOAD_CATCH=ON` to fetch them automatically.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pdd/CLionProjects/pybind11/build

错误提示与解决

errorsolve
Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version “1.56”)Linux平台的boost安装
Catch not detected. Interpreter tests will be skipped. Install Catch headers manually or use cmake -DDOWNLOAD_CATCH=ON to fetch them automatically.同样使用下行的命令解决
Building tests WITHOUT Eigen, use -DDOWNLOAD_EIGEN=ON on CMake 3.11+ to downloadbuild$cmake -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") .. # https://pybind11.readthedocs.io/en/stable/compiling.html#building-with-cmake
  • 命令执行过程:
(yolocopy) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11/build$ cmake  -DDOWNLOAD_EIGEN=ON  -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") ..
-- pybind11 v2.11.0 dev1
-- CMake 3.22.1
-- Found PythonInterp: /home/pdd/anaconda3/envs/yolocopy/bin/python3 (found suitable version "3.7.12", minimum required is "3.6") 
-- Found PythonLibs: /home/pdd/anaconda3/lib/libpython3.9.so
-- PYTHON 3.7.12
-- pybind11::lto enabled
-- pybind11::thin_lto enabled
-- Downloading Eigen 3.4.0 (929bc0e191d0927b1735b9a1ddc0e8b77e3a25ec) from https://gitlab.com/libeigen/eigen.git
-- Building tests with Eigen v3.4.0
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.56")  
-- Downloading catch v2.13.9...
-- Building interpreter tests using Catch v2.13.9
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pdd/CLionProjects/pybind11/build

install

(base) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11/build$ make check -j8
[ 97%] Building CXX object tests/CMakeFiles/pybind11_tests.dir/test_virtual_functions.cpp.o
[100%] Linking CXX shared module pybind11_tests.cpython-39-x86_64-linux-gnu.so
------ pybind11_tests.cpython-39-x86_64-linux-gnu.so file size: 2721000
[100%] Built target pybind11_tests
=========================================================================================================== test session starts ============================================================================================================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
C++ Info: 9.5.0 C++14 __pybind11_internals_v4_gcc_libstdcpp_cxxabi1013__ PYBIND11_SIMPLE_GIL_MANAGEMENT=False
rootdir: /home/pdd/CLionProjects/pybind11/tests, configfile: pytest.ini
plugins: anyio-3.5.0
collected 655 items / 2 skipped                                                                                                                                                                                                            

../../tests/test_async.py ..                                                                                                                                                                                                         [  0%]
../../tests/test_buffers.py .........                                                                                                                                                                                                [  1%]
../../tests/test_builtin_casters.py .....s..............                                                                                                                                                                             [  4%]
../../tests/test_call_policies.py ........                                                                                                                                                                                           [  5%]
../../tests/test_callbacks.py .............s                                                                                                                                                                                         [  8%]
../../tests/test_chrono.py ...........................................                                                                                                                                                               [ 14%]
../../tests/test_class.py ................................                                                                                                                                                                           [ 19%]
../../tests/test_const_name.py ......................                                                                                                                                                                                [ 22%]
../../tests/test_constants_and_functions.py .....                                                                                                                                                                                    [ 23%]
../../tests/test_copy_move.py ....s...                                                                                                                                                                                               [ 24%]
../../tests/test_custom_type_casters.py ...                                                                                                                                                                                          [ 25%]
../../tests/test_custom_type_setup.py ..                                                                                                                                                                                             [ 25%]
../../tests/test_docstring_options.py .                                                                                                                                                                                              [ 25%]
../../tests/test_enum.py .........                                                                                                                                                                                                   [ 27%]
../../tests/test_eval.py ....                                                                                                                                                                                                        [ 27%]
../../tests/test_exceptions.py .........................                                                                                                                                                                             [ 31%]
../../tests/test_factory_constructors.py ...............                                                                                                                                                                             [ 33%]
../../tests/test_gil_scoped.py ..........................................................................................                                                                                                            [ 47%]
../../tests/test_iostream.py ......................                                                                                                                                                                                  [ 50%]
../../tests/test_kwargs_and_defaults.py ........                                                                                                                                                                                     [ 52%]
../../tests/test_local_bindings.py ..........                                                                                                                                                                                        [ 53%]
../../tests/test_methods_and_attributes.py ......................                                                                                                                                                                    [ 57%]
../../tests/test_modules.py .......                                                                                                                                                                                                  [ 58%]
../../tests/test_multiple_inheritance.py ..................                                                                                                                                                                          [ 60%]
../../tests/test_numpy_array.py .........................................................                                                                                                                                            [ 69%]
../../tests/test_numpy_dtypes.py ...............                                                                                                                                                                                     [ 71%]
../../tests/test_numpy_vectorize.py ........                                                                                                                                                                                         [ 73%]
../../tests/test_opaque_types.py ...                                                                                                                                                                                                 [ 73%]
../../tests/test_operator_overloading.py .....                                                                                                                                                                                       [ 74%]
../../tests/test_pickling.py ........                                                                                                                                                                                                [ 75%]
../../tests/test_pytypes.py .............................s........................................................                                                                                                                   [ 88%]
../../tests/test_sequences_and_iterators.py .s............                                                                                                                                                                           [ 90%]
../../tests/test_smart_ptr.py .............                                                                                                                                                                                          [ 92%]
../../tests/test_stl.py ........sss.sss........                                                                                                                                                                                      [ 96%]
../../tests/test_stl_binders.py ..........                                                                                                                                                                                           [ 97%]
../../tests/test_tagbased_polymorphic.py .                                                                                                                                                                                           [ 98%]
../../tests/test_thread.py ..                                                                                                                                                                                                        [ 98%]
../../tests/test_union.py .                                                                                                                                                                                                          [ 98%]
../../tests/test_virtual_functions.py ..........                                                                                                                                                                                     [100%]

========================================================================================================= short test summary info ==========================================================================================================
SKIPPED [1] ../../tests/test_eigen_matrix.py:6: could not import 'pybind11_tests.eigen_matrix': No module named 'pybind11_tests.eigen_matrix'; 'pybind11_tests' is not a package
SKIPPED [1] ../../tests/test_eigen_tensor.py:6: could not import 'pybind11_tests.eigen_tensor': No module named 'pybind11_tests.eigen_tensor'; 'pybind11_tests' is not a package
SKIPPED [1] ../../tests/test_builtin_casters.py:145: no <string_view>
SKIPPED [1] ../../tests/test_callbacks.py:213: Current PYBIND11_INTERNALS_VERSION too low
SKIPPED [1] ../../tests/test_copy_move.py:77: no <optional>
SKIPPED [1] ../../tests/test_pytypes.py:403: Not defined: PYBIND11_HANDLE_REF_DEBUG
SKIPPED [1] ../../tests/test_sequences_and_iterators.py:13: no <optional>
SKIPPED [1] ../../tests/test_stl.py:112: no <optional>
SKIPPED [1] ../../tests/test_stl.py:144: no <experimental/optional>
SKIPPED [1] ../../tests/test_stl.py:176: no <boost/optional>
SKIPPED [1] ../../tests/test_stl.py:235: no <filesystem>
SKIPPED [1] ../../tests/test_stl.py:254: no <variant>
SKIPPED [1] ../../tests/test_stl.py:271: no std::monostate
===================================================================================================== 644 passed, 13 skipped in 11.69s =====================================================================================================
[100%] Built target pytest
[100%] Built target check
(base) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11/build$ sudo make install
[sudo] pdd 的密码: 
[ 87%] Built target pybind11_tests
[ 91%] Built target pybind11_cross_module_tests
[ 95%] Built target cross_module_interleaved_error_already_set
[100%] Built target cross_module_gil_utils
Install the project...
-- Install configuration: "MinSizeRel"
-- Installing: /usr/local/include/pybind11
-- Installing: /usr/local/include/pybind11/iostream.h
-- Installing: /usr/local/include/pybind11/stl.h
-- Installing: /usr/local/include/pybind11/stl_bind.h
-- Installing: /usr/local/include/pybind11/operators.h
-- Installing: /usr/local/include/pybind11/pybind11.h
-- Installing: /usr/local/include/pybind11/cast.h
-- Installing: /usr/local/include/pybind11/eigen
-- Installing: /usr/local/include/pybind11/eigen/tensor.h
-- Installing: /usr/local/include/pybind11/eigen/matrix.h
-- Installing: /usr/local/include/pybind11/eigen.h
-- Installing: /usr/local/include/pybind11/functional.h
-- Installing: /usr/local/include/pybind11/stl
-- Installing: /usr/local/include/pybind11/stl/filesystem.h
-- Installing: /usr/local/include/pybind11/attr.h
-- Installing: /usr/local/include/pybind11/common.h
-- Installing: /usr/local/include/pybind11/eval.h
-- Installing: /usr/local/include/pybind11/detail
-- Installing: /usr/local/include/pybind11/detail/descr.h
-- Installing: /usr/local/include/pybind11/detail/class.h
-- Installing: /usr/local/include/pybind11/detail/typeid.h
-- Installing: /usr/local/include/pybind11/detail/common.h
-- Installing: /usr/local/include/pybind11/detail/init.h
-- Installing: /usr/local/include/pybind11/detail/type_caster_base.h
-- Installing: /usr/local/include/pybind11/detail/internals.h
-- Installing: /usr/local/include/pybind11/options.h
-- Installing: /usr/local/include/pybind11/pytypes.h
-- Installing: /usr/local/include/pybind11/buffer_info.h
-- Installing: /usr/local/include/pybind11/gil.h
-- Installing: /usr/local/include/pybind11/numpy.h
-- Installing: /usr/local/include/pybind11/complex.h
-- Installing: /usr/local/include/pybind11/embed.h
-- Installing: /usr/local/include/pybind11/chrono.h
-- Installing: /usr/local/share/cmake/pybind11/pybind11Config.cmake
-- Installing: /usr/local/share/cmake/pybind11/pybind11ConfigVersion.cmake
-- Installing: /usr/local/share/cmake/pybind11/FindPythonLibsNew.cmake
-- Installing: /usr/local/share/cmake/pybind11/pybind11Common.cmake
-- Installing: /usr/local/share/cmake/pybind11/pybind11Tools.cmake
-- Installing: /usr/local/share/cmake/pybind11/pybind11NewTools.cmake
-- Installing: /usr/local/share/cmake/pybind11/pybind11Targets.cmake
-- Installing: /usr/local/share/pkgconfig/pybind11.pc
  • vim ~/.bashrc
export PYTHONPATH=$PYTHONPATH:/home/pdd/CLionProjects/pybind11/pybind11/  # install location
  • source ~/.bashrc

  • 参考: https://pybind11.readthedocs.io/en/stable/compiling.html#building-with-cmake

use

安装版本的方式报以下错误

/usr/local/include/pybind11/detail/common.h:266:10: fatal error: Python.h: 没有那个文件或目录
  266 | #include <Python.h>
  • include_directories("/home/pdd/anaconda3/envs/yolocopy/include/python3.7m/")

  • target_link_libraries(untitled "/home/pdd/anaconda3/envs/yolocopy/lib/libpython3.7m.so")

 Unknown CMake command "pybind11_add_module".
  • find_package(pybind11 CONFIG REQUIRED)

版本问题

  • 对于版本问题,首先尝试了再安装导出so文件对应的python版本10下执行,然后更改到python3.7也正常运行了

python3.10

在这里插入图片描述

(base) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11_examples-master/01_py-list_cpp-vector/cmake-build-debug$conda create -n py10 python=3.10
(base) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11_examples-master/01_py-list_cpp-vector/cmake-build-debug$ conda activate py10
(py10) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11_examples-master/01_py-list_cpp-vector/cmake-build-debug$ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  example.cbp  example.cpython-310-x86_64-linux-gnu.so  Makefile  pybind11
(py10) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11_examples-master/01_py-list_cpp-vector/cmake-build-debug$ python
Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import example
>>> A = [1.,2.,3.,4.]
>>> B = example.modify(A)
>>> print(B)
[2.0, 4.0, 6.0, 8.0]
>>> exit()

python3.7

  • 按照这种方法更改(设置python3.7对应的目录)bashrc没起作用
# [How to set the default library path for python](https://stackoverflow.com/questions/42548750/how-to-set-the-default-library-path-for-python)
export PYTHON_LIBRARY=/ghome/mypath/anaconda2/lib/libpython2.7.so
export PYTHON_INCLUDE_DIR=/ghome/mypath/anaconda2/include:/ghome/mypath/anaconda2/include/python2.7
  • 但是这个起作用了
(base) pdd@pdd-Dell-G15-5511:/usr/bin$ hisrory
  446  ls pyth*
  447  rm python3
  448  sudo rm python3
  449  ls
  450  ls pytho
  451  ls pytho*
  452  sudo ln -s /home/pdd/anaconda3/envs/yolocopy/bin/python3.7 ./python3
  453  hisrory
  • 运行成功
(yolocopy) pdd@pdd-Dell-G15-5511:~/CLionProjects/pybind11_examples-master/01_py-list_cpp-vector/cmake-build-debug$ python
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import example
>>> A = [1.,2.,3.,4.]
>>> B = example.modify(A)
>>> print(B)
[2.0, 4.0, 6.0, 8.0]

  • 直接拷贝so到其他位置也能运行

在这里插入图片描述

CG

cmake_minimum_required(VERSION 2.8.12)
project(example)
#set(PYBIND11_PYTHON_VERSION "3.7")

#include_directories("/usr/include/python3.10/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
#find_package(OpenCV)
#include_directories(${OpenCV})
include_directories("/home/pdd/anaconda3/envs/yolocopy/bin/")


#link_libraries(${OpenCV_LIBS})
#target_link_libraries(example ${OpenCV_LIBS})
add_subdirectory(pybind11)
pybind11_add_module(example example.cpp)
#add_executable(untitled example.cpp)

target_link_libraries(${PROJECT_NAME} INTERFACE
        ${OpenCV_LIBRARIES}
        pybind11::pybind11
        )

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/371510.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

设计模式(十一)----结构型模式之装饰者模式

1、概述 我们先来看一个快餐店的例子。 快餐店有炒面、炒饭这些快餐&#xff0c;可以额外附加鸡蛋、火腿、培根这些配菜&#xff0c;当然加配菜需要额外加钱&#xff0c;每个配菜的价钱通常不太一样&#xff0c;那么计算总价就会显得比较麻烦。 使用继承的方式存在的问题&…

为多态基类声明virtual析构函数

我们知道&#xff0c;有时会让一个基类指针指向用 new 运算符动态生成的派生类对象&#xff08;类似接口的作用&#xff09;&#xff1b;同时&#xff0c;用 new 运算符动态生成的对象都是通过 delete 指向它的指针来释放的。如果一个基类指针指向用 new 运算符动态生成的派生类…

算法23:多叉树_派对的最大快乐值

公司的每个员工都符合 Employee 类的描述。整个公司的人员结构可以看作是一棵标准的、 没有环的多叉树。树的头节点是公司唯一的老板。除老板之外的每个员工都有唯一的直接上级。 叶节点是没有任何下属的基层员工(subordinates列表为空)&#xff0c;除基层员工外&#xff0c;每…

MySQL知识点小结

事务 进行数据库提交操作时使用事务就是为了保证四大特性,原子性,一致性,隔离性,持久性Durability. 持久性:事务一旦提交,对数据库的改变是永久的. 事务的日志用于保存对数据的更新操作. 这个操作T1事务操作的会发生丢失,因为最后是T2提交的修改,而且T2先进行一次查询,按照A…

线性回归算法和逻辑斯谛回归算法详细介绍及其原理详解

相关文章 K近邻算法和KD树详细介绍及其原理详解朴素贝叶斯算法和拉普拉斯平滑详细介绍及其原理详解决策树算法和CART决策树算法详细介绍及其原理详解线性回归算法和逻辑斯谛回归算法详细介绍及其原理详解 文章目录相关文章前言一、线性回归二、逻辑斯谛回归总结前言 今天给大家…

2020 NOC 编程猫创新编程全国决赛小学组第一部分(客观题)

Q1. 某角色的造型区及未完成的脚本如下,当前造型名称为猫,若想切换到熊冬眠的 浩型,变量次数的值不可能为( ) A. 2 B. 3 C. 4 D. 5 Q2. 运行下图所示脚本,角色的运动轨迹为( ) Q3. 运行脚本,变量“y”的值为( ) A. 200 B. 2200 C. 2000 D. 4000 Q4. 运行…

盘点:9款身份和访问管理工具

身份和访问管理&#xff08;IAM&#xff09;长期以来一直是安全领导者职业生涯的关键“试炼场”&#xff0c;许多人在身份技术部署方面做出了事关成败的决定。 确保安全访问和身份管理是网络安全态势的两大基础 。同时&#xff0c;人员、应用程序和系统登录的方式以及它们彼此集…

以业务行为驱动的反入侵安全能力建设

0x0 背景 最近听到一些甲方安全领域的专家分享了部分安全建设的经验&#xff0c;对安全运营下的反入侵技术能力建设有了些新的看法&#xff0c;依靠单个/多个异构的安全产品的关联能力形成的安全中台并不能在实际的攻防对抗当中占据主动地位&#xff0c;且很容易达到一个天花板…

Mr. Cappuccino的第45杯咖啡——Kubernetes之部署SpringBoot项目

Kubernetes之部署SpringBoot项目创建一个SpringBoot项目将SpringBoot项目打成Jar包使用Dockerfile制作镜像部署SpringBoot项目创建一个SpringBoot项目 pom.xml <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache…

一、前端稳定性规约该如何制定

前言 稳定性是数学或工程上的用语&#xff0c;判别一系统在有界的输入是否也产生有界的输出。若是&#xff0c;称系统为稳定&#xff1b;若否&#xff0c;则称系统为不稳定。 前端稳定性的体系建设大约可以分为了发布前&#xff0c;发布后&#xff0c;以及事故解决后三个阶段…

建立做机器学习项目的范式

建立起做机器学习项目的范式&#xff0c;萃取出核心步骤&#xff0c;避免后面做项目没有明确的方向。 核心步骤&#xff1a; 1、明确自己想做什么样的项目&#xff0c;感兴趣的领域&#xff1b; 2、找到满足项目的数据集&#xff0c;开源的或者自建数据集&#xff1b; 数据…

《数据结构》二叉树面试题

&#x1f451;作者主页&#xff1a;Java冰激凌 &#x1f4d6;专栏链接&#xff1a;数据结构 目录 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先力扣 思路分析 代码 思路拓展 根据一棵树的前序遍历与中序遍历构造二叉树。力扣 思路分析 代码 根据一棵树的中序遍历与…

Linux系统看门狗应用编程

目录看门狗应用编程介绍打开设备获取设备支持哪些功能&#xff1a;WDIOC_GETSUPPORT获取/设置超时时间&#xff1a;WDIOC_GETTIMEOUT、WDIOC_SETTIMEOUT开启/关闭看门狗&#xff1a;WDIOC_SETOPTIONS喂狗&#xff1a;WDIOC_KEEPALIVE看门狗应用编程实战在产品化的嵌入式系统中&…

[计算机网络(第八版)]第二章 物理层(章节测试/章节作业)

章节作业 带答案版 选择题 (单选题)双绞线是用两根绝缘导线绞合而成的&#xff0c;绞合的目的是&#xff08; &#xff09;。 A. 减少干扰 B. 提高传输速度 C. 增大传输距离 D. 增大抗拉强度(单选题)在电缆中采用屏蔽技术可以带来的好处主要是&#xff08; &#xff09;。 A…

DNS 域名解析

介绍域名 网域名称&#xff08;英语&#xff1a;Domain Name&#xff0c;简称&#xff1a;Domain&#xff09;&#xff0c;简称域名、网域。 域名是互联网上某一台计算机或计算机组的名称。 域名可以说是一个 IP 地址的代称&#xff0c;目的是为了便于记忆。例如&#xff0c…

Latex中的表格(2)

Latex中的表格一、一个加脚注的三线表的例子二、一个表格中加注释的例子三、两个并排的两个表格的例子3.1 使用小页环境并排表格3.2 使用子表格并排表格四、一个格式复杂的表格的例子五、一个长表格的例子这篇文章主要罗列一些特殊的表格例子。内容来自&#xff1a;一篇北师大学…

深度剖析数据在内存的存储

目录1.深度剖析数据在内存的存储(前言)数据类型介绍类型的基本归类整形在内存中的存储原码、反码、补码大小端练习总结1.深度剖析数据在内存的存储(前言) 今天就让我戴佳伟给大家讲一下数据在内存中的存储。之中有好多让我们深思的点&#xff0c;大家都拿起笔记本&#xff0c;…

【机器学习笔记】Python基础笔记

目录基础语法加载数据&#xff1a;pd.read_csv查看数据大小&#xff1a;shape浏览数据行字段&#xff1a;columns浏览少量数据&#xff1a;head()浏览数据概要&#xff1a;describe()基础功能语法缺省值去除缺失值&#xff1a;dropna按行删除&#xff1a;存在空值&#xff0c;即…

【数据库】第二章 关系数据库

第二章 关系数据库 2.1关系数据结构及形式化定义 关系 域&#xff08;domain) :域是一组具有相同数据类型的值的集合&#xff0c;可以取值的个数叫基数 笛卡尔积 &#xff1a;一个记录叫做一个元组&#xff08;tuple),元组中每一个属性值&#xff0c;叫一个分量 基数&…

35测试不如狗?是你自己技术不够的怨怼罢了

一、做软件测试怎么样&#xff1f; 引用著名软件测试专家、清华大学郑人杰教授的说法&#xff1a;软件测试工程师是一个越老越吃香的职业。 其中就表达了软件测试工作相对稳定、对年龄没有限制、而且随着项目经验的不断增长和对行业背景的深入了解&#xff0c;会越老越吃香。…