随笔分类 -  python

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 48 下一页
摘要:import json a={'4': 5, '6': 7} print(json.dumps(a, sort_keys=True, indent=4)) 输出 { "4": 5, "6": 7 } 阅读全文
posted @ 2020-01-07 17:20 anobscureretreat 阅读(1950) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2020-01-07 16:17 anobscureretreat 阅读(4254) 评论(0) 推荐(1)
摘要:#coding=utf-8 import requests import time import json url="http://xxx/companies" payload={"companyName":"test产废单位10081934","companyType":2,"companyLinkman":"小明","companyPhone":"13111112222","addr... 阅读全文
posted @ 2020-01-03 01:23 anobscureretreat 阅读(136) 评论(0) 推荐(0)
摘要:#coding=utf-8 import requests import json #获取联单编号 def get_liandan_code(url,producer_code): url=url+"/bc/orders/manual/"+producer_code r = requests.post(url) assert r.json()['code']==... 阅读全文
posted @ 2020-01-03 01:22 anobscureretreat 阅读(137) 评论(0) 推荐(0)
摘要:参考: https://www.cnblogs.com/caicaihong/p/5687522.html http://www.pythonclub.org/python-network-application/urlencode https://www.cnblogs.com/jessicaxu 阅读全文
posted @ 2019-12-26 13:46 anobscureretreat 阅读(397) 评论(0) 推荐(0)
摘要:import sys import os sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1])) from util.getinfolib import getinfo import lib.requests print(getinfo().url) r=requests.get(g 阅读全文
posted @ 2019-12-26 11:13 anobscureretreat 阅读(179) 评论(0) 推荐(0)
摘要:import yaml import os yaml.warnings({'YAMLLoadWarning': False}) filepath = "/".join(os.path.dirname(os.path.abspath(__file__)).split("/")) + "/hostname.yaml" # 写入yaml 文件 # a 追加写入,w,覆盖写入 fw = open(file 阅读全文
posted @ 2019-12-25 19:53 anobscureretreat 阅读(106) 评论(0) 推荐(0)
摘要:#计算当前时间 import datetime datetime.datetime.now() # 2019-06-30 10:51:14.089271 # 格式化时间 datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 2019-06-30 10:52:05 #多加(减)一天 (datetime.datetime.now()... 阅读全文
posted @ 2019-12-25 14:32 anobscureretreat 阅读(2151) 评论(0) 推荐(1)
摘要:>>> import datetime >>> >>> i = datetime.datetime.now() >>> print(i.year,i.month,i.day,i.hour,i.minute,i.second) 2020 12 22 06 12 26 >>> 阅读全文
posted @ 2019-12-22 00:54 anobscureretreat 阅读(394) 评论(0) 推荐(0)
摘要:''' filelist=os.listdir("./report") for i in filelist: if("container" in i): pass else: with open("./report/"+i, 'r') as f: data = json.load(f) if(data["uuid"]=="fac37dfe-c253-458c-96be-820a5b42d589") 阅读全文
posted @ 2019-12-21 17:14 anobscureretreat 阅读(996) 评论(0) 推荐(0)
摘要:参考: https://www.jianshu.com/p/020709b130d3 阅读全文
posted @ 2019-12-20 17:29 anobscureretreat 阅读(1310) 评论(1) 推荐(0)
摘要:python中单引号和双引号是等效的 字符串过长需要换行时,使用\,如 helloworld\ helloworld 或者是直接使用'''(也可以用来注释),如 '''hello world''' 输出let's go的方法 >>> 'let\'s go' "let's go" >>> "let's go" "let's go" >>> '' 阅读全文
posted @ 2019-12-08 22:07 anobscureretreat 阅读(1411) 评论(0) 推荐(0)
摘要:输出 参考: https://www.cnblogs.com/strivepy/p/10436213.html https://www.cnblogs.com/jfl-xx/p/8024596.html https://www.runoob.com/python/func-number-choice 阅读全文
posted @ 2019-12-06 17:29 anobscureretreat 阅读(3729) 评论(0) 推荐(1)
摘要:code 整理后 参考: https://blog.csdn.net/qq562029186/article/details/81203893 阅读全文
posted @ 2019-12-05 16:37 anobscureretreat 阅读(7921) 评论(0) 推荐(0)
摘要:excel code 阅读全文
posted @ 2019-12-03 11:33 anobscureretreat 阅读(4073) 评论(2) 推荐(2)
摘要:#27 import_company def test_import_company(self): headers=self.headers headers["Content-Type"]="multipart/form-data; boundary WebKitFormBoundarywknEiWB8ukxAa0zz" #获取导入模版 file_home = self.import_templa 阅读全文
posted @ 2019-12-02 17:17 anobscureretreat 阅读(211) 评论(0) 推荐(0)
摘要:headers=self.headers #获取导入模版 file_home = self.import_template log.info(file_home) wb = load_workbook(filename=file_home) ws = wb['sheet1'] # 修改产废单位名称,以及备注 ws['b3'] = 'itest产废单位'+self.dic["t"] ws['s3'] 阅读全文
posted @ 2019-12-02 17:16 anobscureretreat 阅读(3640) 评论(0) 推荐(0)
摘要:pip install requests-toolbelt 阅读全文
posted @ 2019-12-02 15:44 anobscureretreat 阅读(5100) 评论(0) 推荐(0)
摘要:#coding=utf8 import time import os def fileTime(file): l=[time.ctime(os.path.getatime(file)),time.ctime(os.path.getctime(file)),time.ctime(os.path.getmtime(file))] return l print("... 阅读全文
posted @ 2019-11-30 15:57 anobscureretreat 阅读(215) 评论(0) 推荐(0)
摘要:调用命令 参考: https://www.cnblogs.com/landhu/p/9910460.html 阅读全文
posted @ 2019-11-27 00:51 anobscureretreat 阅读(1467) 评论(0) 推荐(0)

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 48 下一页