上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 56 下一页

2022年12月26日

elasticsearch 索引增删改示例

摘要: 1.索引条件更新 update collect_material_page_address set IsCollectUri=true where IsCollectUri=false and CollectUri like 'https://www.futureelectronics.cn/sea 阅读全文

posted @ 2022-12-26 12:30 花阴偷移 阅读(30) 评论(0) 推荐(0)

pip 安装包查看

摘要: 一.centos平台 寻找pip安装包的目录方法 [root@iZwz927xptl8kw8zqrmwvcZ bin]# whereis python python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.6-config / 阅读全文

posted @ 2022-12-26 12:28 花阴偷移 阅读(697) 评论(0) 推荐(0)

python 多版本查看与命令用法

摘要: 1.windows查看电脑上是否有多个版本 如果python2能查到,那么用命令时 1、pip是python的包管理工具,pip和pip3版本不同,都位于Scripts\目录下: 2、如果系统中只安装了Python2,那么就只能使用pip。 3、如果系统中只安装了Python3,那么既可以使用pip 阅读全文

posted @ 2022-12-26 12:27 花阴偷移 阅读(706) 评论(0) 推荐(0)

python 异常处理 12

摘要: 当python程序在执行期间发生错误时,如果编写了处理该异常的代码,程序将继续运行;如果未对异常进行处理,程序将停止并显示traceback,其中包含有关异常的报告。异常是使用try- except代码块处理的。告诉python发生异常进怎么办,在try-except代码块中出现异常,程序也将继续运 阅读全文

posted @ 2022-12-26 12:26 花阴偷移 阅读(55) 评论(0) 推荐(0)

python 文件操作 11

摘要: 一.文件读取操作 1. 读取整个文件 在同级目录,创建一个pi_digits.txt文件和file_reader.py文件。 pi_digits.txt文件中加入内容 file_reader.py文件内容如下: with open('pi_digits.txt') as file_object: c 阅读全文

posted @ 2022-12-26 12:26 花阴偷移 阅读(112) 评论(0) 推荐(0)

python if语句 5

摘要: 1.条件测试 cars = ['audi', 'bmw', 'subaru', 'toyota'] for car in cars: if car=='bmw': print(car.upper()) else: print(car.title()) #下面检查不相等 != top='mus' if 阅读全文

posted @ 2022-12-26 12:25 花阴偷移 阅读(21) 评论(0) 推荐(0)

python 字典 6

摘要: 1. 字典增删改 #简单字典用法,用{}表示字典。键和值之间用冒号分隔,而键值对之间用逗号分隔,如下所示 alien_0={'color':'green','points':'5'} print(alien_0['color']) #字典是键值对,每个值可以是字符串,数字,列表,字典 #添加键值对 阅读全文

posted @ 2022-12-26 12:25 花阴偷移 阅读(24) 评论(0) 推荐(0)

python while 7

摘要: 1. 简单的while示例 current_number=1 while current_number<=5 : print(current_number) current_number+=1 2.使用标志 active=True num =1 num_end=10 while active: pr 阅读全文

posted @ 2022-12-26 12:24 花阴偷移 阅读(25) 评论(0) 推荐(0)

python 函数 9

摘要: 1.定义函数 #下面定义一个简单的函数, def关键字用来定义函数 def greet_user(username): print(f"hello-{username}") #调用 greet_user('jesse') #实参和形参,上面变量username是一个形参(parameter),gre 阅读全文

posted @ 2022-12-26 12:24 花阴偷移 阅读(34) 评论(0) 推荐(0)

python 类 10

摘要: 1.创建和使用类 #在python中,首字母大写的名称指的是类 class Dog: #定义方法,该方法是一个特殊方法,每当Dog类创建新实例时,python都会自动运行它 #这个方法的名称中,开头和末尾各有两个下划线,这是一种约定。 #self是必须的形参,指本身实例的引用 def __init_ 阅读全文

posted @ 2022-12-26 12:24 花阴偷移 阅读(16) 评论(0) 推荐(0)

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 56 下一页

导航