随笔分类 -  python

摘要:一、YasDB 的 Python 驱动程序安装 1、找到yasdb的官网的下载地方 官网相关安装包下载:https://download.yashandb.com/download,下载python的驱动 2、直接使用pip方式安装python的驱动 二、ODBC驱动安装(Windows) 下载Ya 阅读全文
posted @ 2025-02-12 09:31 未来可期_Durant 阅读(3) 评论(0) 推荐(0) 编辑
摘要:方案 import yasdbclass YASDBUtil: def __init__(self, host, user, password, port=1688): self.connect = yasdb.connect( host=host, port=port, user=user, pa 阅读全文
posted @ 2025-02-11 17:58 未来可期_Durant 阅读(0) 评论(0) 推荐(0) 编辑
摘要:方案 class DBUtil: def __init__(self, host, database, user, password, port): self.connect = pymysql.Connect( host=host, database=database, user=user, pa 阅读全文
posted @ 2025-02-11 17:37 未来可期_Durant 阅读(1) 评论(0) 推荐(0) 编辑
摘要:下载镜像优化 (推荐https) pip install requests -i https://pypi.douban.com/simple/ 豆瓣镜像 pip install requests -i http://pypi.doubanio.com/simple/ --trusted-host  阅读全文
posted @ 2024-09-07 18:11 未来可期_Durant 阅读(61) 评论(0) 推荐(0) 编辑
摘要:前言 ipython是一个python的交互式shell,比默认的python shell好用得多,支持变量自动补全,自动缩进,支持bash shell命令,内置了许多很有用的功能和函数。学习ipython将会让我们以一种更高的效率来使用python。同时它也是利用Python进行科学计算和交互可视 阅读全文
posted @ 2023-07-12 21:21 未来可期_Durant 阅读(74) 评论(0) 推荐(0) 编辑
摘要:代码实现: from typing import List class Solution: def maximunProduct(self, nums: List[int]) -> int: # 默认是升序 nums.sort() length = len(nums) if length == 3: 阅读全文
posted @ 2022-04-23 23:22 未来可期_Durant 阅读(42) 评论(0) 推荐(0) 编辑
摘要:获取字符串中全部的回文子串 代码: def get_all_Palindrome(item:str): ''' 获取所有的回文字符串 ''' #定义列表,存放所有的回文字符串 res = [] for i in range(len(item)): for j in range(i + 1, len( 阅读全文
posted @ 2022-04-19 16:45 未来可期_Durant 阅读(360) 评论(0) 推荐(0) 编辑
摘要:获取列表中最长的字符号串 代码: import numpy as np# 定义获取列表中最长元素的函数def get_longest_element(item_list: list): # 计算list每个元素的长度 len_list = map(len, item_list) # 实例化 li = 阅读全文
posted @ 2022-04-19 16:35 未来可期_Durant 阅读(397) 评论(0) 推荐(0) 编辑
摘要:filter 过滤 filter() 函数用于过滤序列,过滤掉不符合条件的元素,返回由符合条件元素组成的新列表。 语法:filter(function, iterable) 参数:function(判断函数),iterable (可迭代对象) 返回值: Python 2.x 返回列表 Python 阅读全文
posted @ 2022-04-18 09:41 未来可期_Durant 阅读(193) 评论(0) 推荐(0) 编辑
摘要:一、前言 在我们在使用python进行编码的时候,写出高质量性能好的代码是一个比较好的习惯,line_profiler可很好的帮助我们 二、安装 1、下载 下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#line_profiler 下载想要安装的版本 阅读全文
posted @ 2021-03-30 16:27 未来可期_Durant 阅读(1679) 评论(0) 推荐(0) 编辑

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