This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*unix: ~/.pip/pip.conf | |
Windows: C:\Users\xx\pip,新建文件pip.ini | |
[global] | |
index-url = https://pypi.tuna.tsinghua.edu.cn/simple | |
// 如果是http需要加以下语句: | |
trusted-host = mirrors.aliyun.com | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/__init__.py | |
from flask_login import LoginManager | |
login_manager = LoginManager() | |
login_manager.session_protection = "strong" | |
login_manager.login_view = "auth.login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_to_current_spring(self): | |
res = self.jira.sprints(437) | |
#print(dir(res[0])) | |
#print(res[0].state) | |
for sprint in res: | |
if sprint.state == "ACTIVE": | |
print(isinstance(sprint.id,int)) | |
print(self.new_issue.key) | |
res = self.jira.add_issues_to_sprint(sprint_id=sprint.id,issue_keys=[self.new_issue.key]) | |
print(res) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import requests | |
from bs4 import BeautifulSoup | |
res = requests.get(url) | |
html = res.text | |
# 初始化,指定解析器,默认是html.parser | |
soup = BeautifulSoup(html,"html.parser") | |
# find_all / find |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import argparse | |
parser = argparse.ArgumentParser() | |
mandatory = parser.add_argument_group("Mandatory") | |
mandatory.add_argument('-u','--url',help="URL Target",action="store",type=str,dest="urldest",default=None) | |
dictionary = parser.add_argument_group("Dictionary") | |
dictionary.add_argument('-w','--wordlist',action="store",type=str,dest="wordlist",default="None") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from datetime import datetime | |
from queue import Queue | |
from threading import Thread | |
import requests | |
requests.packages.urllib3.disable_warnings() | |
from bs4 import BeautifulSoup | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 绝对路径 | |
os.pathp.abspath(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 读取文件 | |
# 调用read()会一次性读取文件的全部内容,如果文件有10G,内存就爆了, | |
# 可以反复调用read(size)方法,每次最多读取size个字节的内容。 | |
# 调用readline()可以每次读取一行内容, | |
# 调用readlines()一次读取所有内容并按行返回list。因此,要根据需要决定怎么调用 | |
with open(filepath,'r')as f | |
f.read() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GMT 时间格式 | |
GMT_FORMAT = '%a, %d %b %Y %H:%M:%S GMT' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 如何自定义异常类 | |
class Error(Exception): | |
pass | |
class InputError(Error): | |
def __init__(self,message): | |
self.message = message | |
def __str__(self): | |
return self.message | |
OlderNewer