##参考链接
##问题 - 可能会遇到多个版本同时部署的情况
- 系统自带的Python是2.x,自己需要Python 3.x,测试尝鲜;
- 系统是2.6.x,开发环境是2.7.x
- 由于Mac机器系统保护的原因,默认的Python中无法对PIP一些包升级,需要组建新的Python环境
- 此时需要在系统中安装多个Python,但又不能影响系统自带的Python,即需要实现Python的多版本共存。pyenv就是这样一个Python版本管理器
##解决方法 - pyenv
| DOWNLOAD_HANDLERS = { | |
| 'http': 'myspider.socks5_http.Socks5DownloadHandler', | |
| 'https': 'myspider.socks5_http.Socks5DownloadHandler' | |
| } |
| /* | |
| * Genarate rsa keys. | |
| */ | |
| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/x509" |
##参考链接
##问题 - 可能会遇到多个版本同时部署的情况
##解决方法 - pyenv
| package main | |
| import ( | |
| "database/sql" | |
| "strconv" | |
| "log" | |
| "net/http" | |
| "fmt" | |
| "bytes" | |
| "gopkg.in/gin-gonic/gin.v1" |
| package main | |
| import ( | |
| "strings" | |
| ) | |
| func main() { | |
| strings.HasSuffix("foobar", "bar") // true | |
| } |
| // This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally | |
| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "golang.org/x/crypto/ssh" |
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |