随笔分类 -  PYTHON

1 2 3 4 5 ··· 8 下一页
摘要:python3: import base64 import hmac import json import logging import random import time import uuid import requests class ExecutableClient: api_server 阅读全文
posted @ 2025-04-09 18:58 NAVYSUMMER 阅读(15) 评论(0) 推荐(0)
摘要:1.创建帐号密码文件,并添加内容 touch /opt/pyserver/.htpasswd echo "username:password" > /opt/pyserver/.htpasswd 2.创建包路径 mkdir /opt/pyserver/packages 3.创建私有仓库 # 不带转发 阅读全文
posted @ 2024-08-11 14:18 NAVYSUMMER 阅读(175) 评论(0) 推荐(0)
摘要:from openpyxl import Workbook from openpyxl.utils import column_index_from_string, get_column_letter # 创建一个Workbook对象 workbook = Workbook() sheet = wo 阅读全文
posted @ 2023-11-15 16:56 NAVYSUMMER 阅读(245) 评论(0) 推荐(0)
摘要:test.py class A: def a(self): pass @staticmethod def b(): pass @classmethod def c(cls): pass @property def d(self): return 1 e = 1 def f(): pass test2 阅读全文
posted @ 2023-10-23 14:42 NAVYSUMMER 阅读(22) 评论(0) 推荐(0)
摘要:1.安装openssl11 yum 安装 openssl 1.1.1k 2.安装依赖 yum install xz-devel zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make lib 阅读全文
posted @ 2023-08-19 15:20 NAVYSUMMER 阅读(174) 评论(0) 推荐(0)
摘要:class NoModifyMeta(type): def __setattr__(cls, key, value): raise AttributeError(f"Cannot modify class attribute '{key}'") class ConstDict(metaclass=N 阅读全文
posted @ 2023-07-27 23:56 NAVYSUMMER 阅读(95) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- import os import subprocess import threading import time import tkinter from tkinter import TOP, LEFT, RIGHT, messagebox, file 阅读全文
posted @ 2023-07-22 23:54 NAVYSUMMER 阅读(25) 评论(0) 推荐(0)
摘要:import cv2 import subprocess input_video_path = "/home/navy/Desktop/1.mp4" opencv_video_path = "/home/navy/Desktop/2.mp4" new_video_path = "/home/navy 阅读全文
posted @ 2023-07-22 17:16 NAVYSUMMER 阅读(212) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- import os import threading import time import tkinter from tkinter import TOP, LEFT, RIGHT, messagebox, filedialog, DISABLED, 阅读全文
posted @ 2023-07-22 16:10 NAVYSUMMER 阅读(19) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- import os import time import cv2 import numpy from PIL import Image, ImageDraw, ImageFont ascii_char = list("$@B%8&WM#*oahkbdp 阅读全文
posted @ 2023-07-22 15:04 NAVYSUMMER 阅读(19) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*- import os import threading import tkinter from tkinter import LEFT, RIGHT, filedialog, messagebox, DISABLED, NORMAL, TOP impor 阅读全文
posted @ 2023-07-22 03:53 NAVYSUMMER 阅读(16) 评论(0) 推荐(0)
摘要:1.安装 pip3 install -U lesscode_tool 2.创建项目(目前仅支持创建lesscode-py,其他项目请用subcommand实现) 2.1创建lesscode-py项目 lesscodeTool new -d test 2.2创建django项目 lesscodeToo 阅读全文
posted @ 2023-05-03 21:58 NAVYSUMMER 阅读(38) 评论(0) 推荐(0)
摘要:import re def to_camel_case(x): """转驼峰法命名""" return re.sub('_([a-zA-Z])', lambda m: (m.group(1).upper()), x) def to_upper_camel_case(x): """转大驼峰法命名""" 阅读全文
posted @ 2023-05-02 20:07 NAVYSUMMER 阅读(219) 评论(0) 推荐(0)
摘要:# 不带密码认证的 docker run --name pypi --restart always -p 8080:8080 -d pypiserver/pypiserver -P . -a . # 带密码认证的 docker run --name pypi --restart always -v 阅读全文
posted @ 2023-04-11 22:47 NAVYSUMMER 阅读(177) 评论(0) 推荐(0)
摘要:def es_mapping2dict(mapping): mapping_dict = dict() if isinstance(mapping, dict): if "properties" in mapping: for k, v in mapping.get("properties").it 阅读全文
posted @ 2023-04-08 01:30 NAVYSUMMER 阅读(15) 评论(0) 推荐(0)
摘要:def data2single_dict(source): stack = [(source, "")] result = {} while stack: obj, parent_name = stack.pop() if isinstance(obj, dict): for k, v in obj 阅读全文
posted @ 2023-04-08 00:31 NAVYSUMMER 阅读(12) 评论(0) 推荐(0)
摘要:def es_mapping2dict(mapping): mapping_dict = dict() if isinstance(mapping, dict): if "properties" in mapping: for k, v in mapping.get("properties").it 阅读全文
posted @ 2023-04-07 23:18 NAVYSUMMER 阅读(11) 评论(0) 推荐(0)
摘要:def convert_query(query): """ Convert Elasticsearch query to use keyword and text fields appropriately """ if isinstance(query, dict): for key, value 阅读全文
posted @ 2023-04-07 23:13 NAVYSUMMER 阅读(104) 评论(0) 推荐(0)
摘要:在项目的根目录里创建setup.py # -*- coding: utf-8 -*- # author:navysummer # email:navysummer@yeah.net import shutil import setuptools from setuptools.command.ins 阅读全文
posted @ 2022-12-04 20:48 NAVYSUMMER 阅读(47) 评论(0) 推荐(0)
摘要:python依赖 paddleocr==2.5.0.3 paddlepaddle==2.3.1 python示例 #!/user/bin/env python # coding=utf-8 import logging import re from paddleocr import PaddleOC 阅读全文
posted @ 2022-08-13 22:42 NAVYSUMMER 阅读(199) 评论(0) 推荐(0)

1 2 3 4 5 ··· 8 下一页
交流群 编程书籍