小编dbo*_*boy的帖子

ModuleNotFoundError:没有名为“pyinputplus”的模块

当我尝试在 google colab 中运行此代码时,它显示模块未找到错误。这是我的代码

   import pyinputplus as pyip

   response = pyip.inputNum('Enter num: ')
Run Code Online (Sandbox Code Playgroud)

python google-colaboratory

4
推荐指数
1
解决办法
1837
查看次数

如何在 Visual Studio Code 中激活自动尖括号 `<>` 配对完成?

我只是不知道如何<>在 Visual Studio Code 中激活自动尖括号配对,就像它存在于圆括号{}、圆括号()或方[]括号中一样。任何人都有任何线索,在设置中我可以配置它吗?

autocomplete visual-studio-code

3
推荐指数
1
解决办法
3461
查看次数

如何修复“错误:'_1' 未在此范围内声明”?

我目前正在尝试将函数绑定到我打算使用的算法。

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
    vector<int> coll{1, 2, 3, 4, 5, 6};

    vector<int>::iterator pos;
    pos = find_if (coll.begin(), coll.end(), 
                    bind(greater<int>(),_1,3)); 

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

并获得此错误反馈:

AlgoTesting.cpp: In function ‘int main()’:
AlgoTesting.cpp:184:41: error: ‘_1’ was not declared in this scope
                     bind(greater<int>(),_1,3)); // criterion
                                         ^~
AlgoTesting.cpp:184:41: note: suggested alternative:
In file included from algostuff.hpp:15:0,
                 from AlgoTesting.cpp:5:
/usr/include/c++/7/functional:275:34: note:   ‘std::placeholders::_1’
     extern const _Placeholder<1> _1;
                                  ^~
Run Code Online (Sandbox Code Playgroud)

我正在努力理解错误日志的含义。有谁知道我在这里想念什么?

c++ binding stl c++11

2
推荐指数
1
解决办法
1811
查看次数