git的命令行操作

声明当前目录为git仓库 git init 绑定远端仓库 git remote add origin 仓库的URL 拉取远端仓库的内容 git pull 添加当前目录所有文件到缓存 git add . 提交一个记录 git commit -a "...

修改配置文件,添加maven阿里云镜像

settings.xml文件内容 <localRepository>/Users/renzilong/.m2/repository</localRepository> 更改本地maven仓库路径 <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://ma...

switch(多分支选择)的实现

Python 中没有 switch/case 语法,如果使用 if/elif/else 会出现代码过长、不清晰等问题。 而借助字典就可以实现 switch 的功能 def case1(): # 第一种情况执行的函数 pri...

列表换行join函数

int = '\n' float = ' ' str = [] a = input('任务名称:\n') b = input('等级限制 最低等级:\n') c = input('最高等级:\n') d = input('任务简介:\n') str.append(a) str.append('%s~%s' % (b, c)) str.appe...

HAI.py

import requests a = 5 b = input('你要做什么?\n1.爬小说') if b == '1': while True: res = requests.get('http://www.xbiquge.la/13/13959/593902%s.html' % a) res.encoding = 'utf-8'...

Python中过滤HTML标签的函数

#用正则简单过滤html的<>标签 import re str = "<img /><a>srcd</a>hello</br><br/>" str = re.sub(r'</?\w+[^>]*>','',str) print (str) import re test='<p>just for test</p>...

MacOS 解决“import requests No module named requests”

MacOS 解决“import requests No module named requests” 系统信息 sw_vers ProductName: Mac OS X ProductVersion: 10.12.2 BuildVersion: 16C67 2.测试脚本 #内容如下: cat test.py #!/usr/...