上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 37 下一页
摘要: 原文链接:https://blog.csdn.net/hihell/article/details/89344558 一、Python里面如何实现tuple和list的转换? 函数tuple(seq)可以把所有可迭代的(iterable)序列转换成一个tuple, 元素不变,排序也不变 list转为 阅读全文
posted @ 2020-10-11 22:27 何双新 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 描述 Python replace() 方法把字符串中的 old(旧字符串) 替换成 new(新字符串),如果指定第三个参数max,则替换不超过 max 次。 语法 replace()方法语法: str.replace(old, new[, max]) 实例1 #!/usr/bin/python s 阅读全文
posted @ 2020-10-03 10:56 何双新 阅读(2365) 评论(0) 推荐(0) 编辑
摘要: 一、二分法查找:适用于有序的列表查找想要的元素。 操作对象:数组 使用前提:有序的数组 性能方面:时间复杂度O(logn) # -*- coding: utf-8 -*- def binary_search(list, item): low = 0 high = len(list) - 1 sequ 阅读全文
posted @ 2020-10-02 22:18 何双新 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Python2中StringIO调用方法如下: import StringIO iost = StringIO.StringIO() Python3中已将StringIO归入io,调用方法如下: import io iost = io.StringIO() 阅读全文
posted @ 2020-09-19 20:27 何双新 阅读(847) 评论(0) 推荐(0) 编辑
摘要: 一、python生成时间戳 # 案例 生成时间戳 import time t = time.time() print(t) # 原始时间数据 print(int(t)) # 秒级时间戳 print(int(round(t * 1000))) # 毫秒级时间戳 print(int(round(t * 阅读全文
posted @ 2020-09-17 21:52 何双新 阅读(1306) 评论(0) 推荐(0) 编辑
摘要: python中调用API的几种方式: - urllib2- requests 一、调用别人的接口 案例1、urllib2 import urllib2, urllib github_url ='https://api.github.com/user/repos' password_manager = 阅读全文
posted @ 2020-09-09 21:47 何双新 阅读(10019) 评论(0) 推荐(0) 编辑
摘要: 1、外网穿透工具下载与注册【http://ngrok.ciqiuwl.cn/】 2、公众号审请 3、代码编写 糗事百科接口 # _*_ coding:utf-8 _*_ import requests from lxml import etree from random import randint 阅读全文
posted @ 2020-09-01 22:47 何双新 阅读(1226) 评论(6) 推荐(0) 编辑
摘要: 百度AI:https://ai.baidu.com 申请App_id 代码重点:pip install baidu_api from aip import AipOcr import os # 百度识别车牌 # 申请地址 http://ai.baidu.com/ # 请将您申请的Key写到项目根目录 阅读全文
posted @ 2020-08-29 16:24 何双新 阅读(1521) 评论(0) 推荐(0) 编辑
摘要: 安装软件:anaconda 一、下载: 方式一:在官网下载:https://www.anaconda.com/products/individual 方式二:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 阅读全文
posted @ 2020-08-08 08:11 何双新 阅读(207) 评论(0) 推荐(0) 编辑
摘要: PyInstaller工具是跨平台的,它既可以在 Windows平台上使用,也可以在 Mac OS X 平台上运行。在不同的平台上使用 PyInstaller 工具的方法是一样的,它们支持的选项也是一样的。 PyInstaller 支持的常用选项 1、安装pyinstaller库:pip insta 阅读全文
posted @ 2020-08-06 07:02 何双新 阅读(890) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 37 下一页