logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

Python 字典和json相互转换

示例中使用了一种新的字符格式化输出格式,最后会有说明字典转为json#!/usr/bin/env python# -*- coding: utf-8 -*-import jsondic1 = {'name': '张三','id': [119, 123]}# 字典转为jsonresult_1 = json.dumps(dic1, ensure_ascii=False)print(f'result_1

#python#json
Linux安装Apache环境(有图有真相!)

准备在Linux服务器上搭建Apache环境,找了好多资料,最终成功了!,下面是用到的资源和参考的资料,希望可以帮到有需要的朋友。一、资源:链接:https://pan.baidu.com/s/1zG-KLlHFFqxFTh_hco435g提取码:afo5你可能会用到的(用我给的资源一般就可以了):Apache官方资源下载:http://httpd.apache.org/downloa...

#服务器
sqlAlchemy基本使用

#!/usr/bin/env python# -*- coding: utf-8 -*-# TODO 创建数据库create table user (id varchar(20) primary key auto, name varchar(20))# TODO 基本的增删该查# 导入依赖from sqlalchemy import Column, String, creat...

#数据库
《算法图解》记录1

二分法查找有序序列中(列表),某元素的索引#!/usr/bin/env python# -*- coding: utf-8 -*-# 二分法查找有序序列中(列表),某元素的索引def get_idx(list, item):start = 0end = len(list) - 1while start <= end:mid = i...

#算法#python
使用python调用Windows程序的几种方法

#!/usr/bin/env python# -*- coding: utf-8 -*-import os#-------------------------------------------方法一os.system("notepad.exe")# 打开记事本默认堵塞from subprocess import Popen#----------------------...

Python当前时间的几种表示方式

#!/usr/bin/env python# -*- coding: utf-8 -*-import timet1 = time.time()# 当前时间戳print('t1:', t1)t2 = time.ctime()print('t2:', t2)t3 = time.localtime()# 时间元组,默认参数为当前时间戳print('t3:', t3)t4 = ...

Python使用random实现双色球、大乐透随机选号

版本一#!/usr/bin/env python# -*- coding: utf-8 -*-from random import randintfrom time import sleep# 双色球 红1~33蓝1~16# 大乐透 红1~35蓝1~12def SSQ(try_nums):"""双色球随机选号"""red_num_li = []...

Python 不使用 time.sleep() 实现倒计时

#!/usr/bin/env python# -*- coding: utf-8 -*-import timetime_set = 120# 计时设定时间SYSJ = None# 剩余时间start_time = time.time()while True:t1 = time.time() - start_time# 计时时间间隔SYSJ = ti...

Python实现学生信息管理

#!/usr/bin/env python# -*- coding: utf-8 -*-# 学生信息 姓名,性别class Student():"""用于创建学生对象"""def __init__(self, name, gender, *args, **kwargs):self.name = nameself.gender = ...

#python
Python 字典和json相互转换

示例中使用了一种新的字符格式化输出格式,最后会有说明字典转为json#!/usr/bin/env python# -*- coding: utf-8 -*-import jsondic1 = {'name': '张三','id': [119, 123]}# 字典转为jsonresult_1 = json.dumps(dic1, ensure_ascii=False)print(f'result_1

#python#json
    共 18 条
  • 1
  • 2
  • 请选择