[user]
    name = wameidemao
    email = u2nn@qq.com
[core]
    autocrlf = false
    quotepath = false
[alias]
    st = status
    ci = commit
    co = checkout
    br = branch
    gp = log --graph --all --oneline
[log]
    date = iso

~/.gitconfig

server {
        listen 80;

        server_name jenkins.yueqiumao.com;

        location / {
                proxy_pass http://127.0.0.1:8080;
                proxy_set_header X-Forwarded-Host $host:$server_port;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Real-IP $remote_addr;
        }
}

child = subprocess.Popen(args, shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
child.wait() # 等待进程结束
child.stderr.read() # 获得 stderr 的输出内容

args 可以传入 字符串 或者 字符串数组
shell False 直接执行 args 数组第一个元素指定的可执行文件,True 先执行 shell 进程,然后把 args 字符串传递给它执行 (linux 类似 ['/bin/sh', '-c'] windows ['cmd.exe', '/c'])

subprocess 常用的方法:

  • poll 检查进程是否结束,并设置返回值,None表示还没结束
  • wait 等待进程结束,并设置返回值
  • communicate // TODO
  • terminate 终止进程
  • kill 杀死进程(发送 SIGKILL 信号)