博客 / 列表

代碼的路 - pip安裝更換鏡像

原文鏈接 使用pip來安裝python包有時候安裝起來會非常慢,因此需要換成國內的源來加速下載: 1 單次修改源 以Torch為例,常規下載方式為: pip install torch 修改為阿里源: pip install -i https://mirrors.aliyun.com/pypi/simple torch 2 修改默認源 如果不想在每一次下載都指定源,可以直接修改默認源。 2.1 L

pip , 程序員 , Python

代碼的路 - pip安裝報錯:UnicodeDecodeError 'utf-8' codec can't decode byte 0xc3

原文鏈接 使用pip命令安裝模塊時,若出現報錯: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 4: invalid continuation byte 因為windows下命令行的代碼頁為GBK,但是程序編碼是UTF-8。 解決辦法 找到python安裝目錄下\Lib\site-packages\pip\

pip , 程序員 , Python

代碼的路 - C++ 自定義二叉樹並輸出二叉樹圖形

原文鏈接 使用C++構建一個二叉樹並輸出。 輸入 輸入根節點為10,依次輸入6、4、8、14、12、16 代碼如下: #include stdio.h #include stdlib.h #include vector #includeiostream #include stack #includecstdlib #include string using namespace std; s

c++ , 二叉樹

代碼的路 - C++ 構建並複製二叉樹

原文鏈接 使用C++構建一個二叉樹並複製、輸出。 程序 #include stdio.h #include stdlib.h //#include cstdio #include vector #includeiostream #include stack #includecstdlib #include string using namespace std; struct TreeNo

c++ , 二叉樹