我刚刚在 macOS Catalina 上安装了 pyenv,并且使用命令收到以下错误消息pyenv doctor:
Cloning /Users/joel.rontynen/.pyenv/plugins/pyenv-doctor/bin/.....
Installing python-pyenv-doctor...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 10.15.7 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201014132428.46509
Results logged to /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201014132428.46509.log
Last 10 log lines:
checking readline/readline.h, presence... no
checking for readline/readline.h,... no
checking readline/rlconf.h usability... yes
checking readline/rlconf.h presence... yes
checking for readline/rlconf.h... yes
checking for SSL_library_init in -lssl... no
configure: WARNING: OpenSSL <1.1 not installed. …Run Code Online (Sandbox Code Playgroud) 我正在运行以下程序
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char *argv[])
{
ifstream input_file(argv[1]);
vector<string> words;
string line;
while(getline(input_file, line))
{
cout << line << endl;
words.push_back(line);
}
input_file.close();
cout << "First and last word: " << words[0] << " " << words.back() << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
使用以下文本文件作为输入
permission
copper
operation
cop
rationale
rest
Run Code Online (Sandbox Code Playgroud)
我在终端中得到以下输出
permission
copper
operation
cop
rationale
rest
rest and last word: permission
Run Code Online (Sandbox Code Playgroud)
为什么words.back()在擦除某些文本时将最后一个字打印在行首?