随笔分类 -  python

摘要:转载 地址 https://blog.csdn.net/buluxianfeng/article/details/125376955 wget https://download.oracle.com/otn_software/linux/instantclient/217000/oracle-ins 阅读全文
posted @ 2022-09-21 17:29 睁yan-ii 阅读(35) 评论(0) 推荐(0) 编辑
摘要:http://t.zoukankan.com/leokale-zz-p-12155852.html 安装Anaconda到/usr/local/anaconda3目录下。 为python3创建软连接: ln -s /usr/local/anaconda3/bin/python /usr/bin/py 阅读全文
posted @ 2022-06-22 18:09 睁yan-ii 阅读(315) 评论(0) 推荐(0) 编辑
摘要:and的返回值规律: and :从左到右计算表达式,若所有值均为真,则返回最后一个值,若存在假,返回第一个假值。对于and的测试,从左到右计算表达式,遇到一个假时,满足一假俱假,不在执行后面的语句,返回第一个假值。若所有的都为真,则返回最后一个值, or的返回值规律:从左到右计算表达式,只要遇到一个 阅读全文
posted @ 2022-04-01 17:29 睁yan-ii 阅读(58) 评论(0) 推荐(0) 编辑
摘要:1. 查看当前python版本 root@iZwz99sau950q2nhb3pn0aZ ~]# python Python 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2 阅读全文
posted @ 2021-12-14 17:52 睁yan-ii 阅读(47) 评论(0) 推荐(0) 编辑
摘要:>>> import datetime >>> today=datetime.date.today() >>> print today 2018-01-17 >>> formatted_today=today.strftime('%y%m%d') >>> print formatted_today 阅读全文
posted @ 2021-08-25 17:58 睁yan-ii 阅读(99) 评论(0) 推荐(0) 编辑
摘要:python 获取星期几 from datetime import datetime dayOfWeek = datetime.now().isoweekday() ###返回数字1-7代表周一到周日 day_Week = datetime.now().weekday() ###返回从0开始的数字, 阅读全文
posted @ 2021-08-25 17:56 睁yan-ii 阅读(2026) 评论(0) 推荐(0) 编辑
摘要:废话少说直接上代码 a='百度;www.baidu.com' from xpinyin import Pinyin # 实例拼音转换对象 p = Pinyin() # 进行拼音转换 ret = p.get_pinyin(u"百度;www.baidu.com", tone_marks='marks') 阅读全文
posted @ 2021-08-13 15:01 睁yan-ii 阅读(289) 评论(0) 推荐(0) 编辑
摘要:# coding:utf-8 import os '''***获取当前目录***''' print(os.getcwd()) print(os.path.abspath(os.path.dirname(__file__))) '''***获取上级目录***''' print(os.path.absp 阅读全文
posted @ 2021-08-13 10:44 睁yan-ii 阅读(1204) 评论(0) 推荐(0) 编辑
摘要:http://www.shsnc.com/show-109-1004-1.html import pymysql def insert_sql(sql): eng = pymysql.connect(host='123.56.2.32', user='root', password='123456' 阅读全文
posted @ 2021-08-11 19:41 睁yan-ii 阅读(1448) 评论(0) 推荐(0) 编辑
摘要:1 在当前文件创建helloworld.py文件 import os os.system('C:\python36\python.exe helloworld.py ') # 指定路径 执行helloworld.py 文件 2 周期性执行helloworld.py 文件 import time,os 阅读全文
posted @ 2021-08-10 17:57 睁yan-ii 阅读(324) 评论(0) 推荐(0) 编辑
摘要:参照链接 https://www.cnblogs.com/jiablogs/p/11978204.html import os def del_file(filepath): """ 删除execl目录下的所有文件或文件夹 :param filepath: 路径 :return: """ del_l 阅读全文
posted @ 2021-08-10 14:50 睁yan-ii 阅读(512) 评论(0) 推荐(0) 编辑
摘要:1.str转dict 内置函数eval s = "{'a':1,'b':2}" sd = eval(s) print(type(sd),sd['a']) #<class 'dict'> 1 json包 import json s = '{"a":1,"b":2}' sd = json.loads(s 阅读全文
posted @ 2021-07-26 18:31 睁yan-ii 阅读(1475) 评论(0) 推荐(0) 编辑
摘要:参考连接 https://blog.csdn.net/jx950915/article/details/90691870 安装模块 1、pyinstaller这里建议最好使用命令安装,手动下载安装有很多其他的模块不存在,我就一开始是手动安装,安装一次缺一个模块,然后补一个,然后又少一个,命令行安装就 阅读全文
posted @ 2021-07-21 14:35 睁yan-ii 阅读(161) 评论(0) 推荐(0) 编辑
摘要:官网链接 https://docs.python.org/zh-cn/3/library/re.html re 判断ip是否正确 def check_ip(ipAddr): compile_ip=re.compile('^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9]) 阅读全文
posted @ 2021-07-20 10:57 睁yan-ii 阅读(199) 评论(0) 推荐(0) 编辑
摘要:不知道你是否发现,身边聊异步的人越来越多了,比如:FastAPI、Tornado、Sanic、Django 3、aiohttp等。 听说异步如何如何牛逼?性能如何吊炸天。。。。但他到底是咋回事呢? 本节要跟大家一起聊聊关于asyncio异步的那些事! 参照 博客 https://www.cnblog 阅读全文
posted @ 2021-07-14 14:01 睁yan-ii 阅读(125) 评论(0) 推荐(0) 编辑
摘要:qq聊天窗口需要打开 import win32gui import win32con import win32clipboard class CSendQQMsg(): def __init__(self, friendName, msg): self.friendName = friendName 阅读全文
posted @ 2021-06-29 17:18 睁yan-ii 阅读(500) 评论(0) 推荐(0) 编辑
摘要:参照地址 https://mp.weixin.qq.com/s/7HbKSXl2kJJH5DecSYXYFA import os import requests from bs4 import BeautifulSoup # 声明请求头 headers = { 'User-Agent': 'Mozi 阅读全文
posted @ 2021-06-24 18:43 睁yan-ii 阅读(385) 评论(0) 推荐(0) 编辑
摘要:import requests def download_file(url, path): with requests.get(url, stream=True) as r: chunk_size = 1024 content_size = int(r.headers['content-length 阅读全文
posted @ 2021-06-03 11:50 睁yan-ii 阅读(50) 评论(0) 推荐(0) 编辑
摘要:1 2.生成requirements.txt文件:pip freeze > requirements.txt 3.安装requirements.txt依赖:pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simpl 阅读全文
posted @ 2021-05-18 18:34 睁yan-ii 阅读(125) 评论(0) 推荐(0) 编辑
摘要:''' 秒杀程序 ''' import os import arrow import redis from multiprocessing import Pool from redlock.lock import RedLock HOTKEY = 'num' # 设置秒杀数量 r = redis.R 阅读全文
posted @ 2021-05-07 18:30 睁yan-ii 阅读(24) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示