百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 编程字典 > 正文

python生成指定年份所有的天,并计算每天属于一年的第几周和周几

toyiye 2024-06-21 12:38 12 浏览 0 评论

欢迎关注本人博客【Together_CZ】,我是沂水寒城,本文CSDN首发地址:

https://yishuihancheng.blog.csdn.net/article/details/97028074u

Together_CZ

本文想要分享的内容是有关于python中日期的计算相关的内容,我在前一段时间的工作里面有一个需求就是我们需要计算每一周的目标数据,这里我最初以为的每一周就是对于每个月进行划分,每7天是一周,最后不足七天的算一周,最后跟业务端对接确认的时候发现不是这样理解的,他们要求的是按照日期中的周的划分来计算每一周的目标数据的,那么这里就出现了冲突了,需要我这边修改一下原始的计算逻辑,这一点也反映了一个道理:就是做事执行之前一定要跟需求端对接确认清楚才好哇,O(∩_∩)O哈哈~

闲话就说到这里了,其实实现需求端需要的功能并不困难,因为python中对于日期的计算已经提供了很好的封装和实现了,我们要做的就是调用相应的函数进行组合计算得到我们需要的计算结果就好了,整体的实现很简单,主要就是要考虑仔细一点,比如:闰年的时候2月是29天,一些细节问题处理好了就行了。

下面我们来看一下我的具体实现,仅作为参考,欢迎交流指导:

#!usr/bin/env python
# encoding:utf-8
from __future__ import division
 
"""
__Author__:沂水寒城
功能: python生成指定年份所有的天,并计算每天属于一年的第几周和周几
"""
 
 
import time
import datetime
 
month_list = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
month_day_dict = {
 "01": 31,
 "02": 28,
 "03": 31,
 "04": 30,
 "05": 31,
 "06": 30,
 "07": 31,
 "08": 31,
 "09": 30,
 "10": 31,
 "11": 30,
 "12": 31,
}
 
 
def string2Datetime(timestamp, format="%Y-%m-%d %H:%M:%S"):
 """
 把字符串转成datetime
 """
 return datetime.datetime.strptime(timestamp, format)
 
 
def judgeRunYear(year=2019):
 """
 判断是否是闰年
 """
 if (year % 100 != 0 and year % 4 == 0) or (year % 100 == 0 and year % 400 == 0):
 return True
 else:
 return False
 
 
def generateMonthDays(month_day_dict, year="2017", month="03"):
 """
 生成指定年份、月份中的所有日期
 """
 day_num = month_day_dict[month]
 day_date_list = []
 for i in range(1, day_num + 1):
 one = str(i)
 if len(one) == 1:
 one = "0" + one
 day_date_list.append(year + "-" + month + "-" + one)
 return day_date_list
 
 
def genenrateYearDays(year=2019):
 """
 生成一年中所有的日期
 """
 res_list = []
 if judgeRunYear(year=year):
 month_day_dict["02"] = 29
 for one_mon in month_list:
 one_mon_day = generateMonthDays(month_day_dict, year=str(year), month=one_mon)
 res_list += one_mon_day
 return res_list
 
 
def singleDateHandle(day="2019-07-19", format="%Y-%m-%d"):
 """
 单日处理
 """
 T = string2Datetime(day, format=format)
 weekDay = T.weekday() + 1
 weekNum = T.isocalendar()[1]
 return weekDay, weekNum
 
 
def genenrateYearDaysWeek(year=2019):
 """
 计算生成一年中每一天属于 第几周 周几
 """
 year_day_list = genenrateYearDays(year=year)
 for one_day in year_day_list:
 weekDay, weekNum = singleDateHandle(day=one_day)
 print("{0} is: {1}th week, {2}th day.".format(one_day, weekNum, weekDay))
 
 
if __name__ == "__main__":
 genenrateYearDaysWeek(year=2019)

接下来对上述代码进行简单的测试,结果输出如下:

2019-01-01 is: 1th week, 2th day.
2019-01-02 is: 1th week, 3th day.
2019-01-03 is: 1th week, 4th day.
2019-01-04 is: 1th week, 5th day.
2019-01-05 is: 1th week, 6th day.
2019-01-06 is: 1th week, 7th day.
2019-01-07 is: 2th week, 1th day.
2019-01-08 is: 2th week, 2th day.
2019-01-09 is: 2th week, 3th day.
2019-01-10 is: 2th week, 4th day.
2019-01-11 is: 2th week, 5th day.
2019-01-12 is: 2th week, 6th day.
2019-01-13 is: 2th week, 7th day.
2019-01-14 is: 3th week, 1th day.
2019-01-15 is: 3th week, 2th day.
2019-01-16 is: 3th week, 3th day.
2019-01-17 is: 3th week, 4th day.
2019-01-18 is: 3th week, 5th day.
2019-01-19 is: 3th week, 6th day.
2019-01-20 is: 3th week, 7th day.
2019-01-21 is: 4th week, 1th day.
2019-01-22 is: 4th week, 2th day.
2019-01-23 is: 4th week, 3th day.
2019-01-24 is: 4th week, 4th day.
2019-01-25 is: 4th week, 5th day.
2019-01-26 is: 4th week, 6th day.
2019-01-27 is: 4th week, 7th day.
2019-01-28 is: 5th week, 1th day.
2019-01-29 is: 5th week, 2th day.
2019-01-30 is: 5th week, 3th day.
2019-01-31 is: 5th week, 4th day.
2019-02-01 is: 5th week, 5th day.
2019-02-02 is: 5th week, 6th day.
2019-02-03 is: 5th week, 7th day.
2019-02-04 is: 6th week, 1th day.
2019-02-05 is: 6th week, 2th day.
2019-02-06 is: 6th week, 3th day.
2019-02-07 is: 6th week, 4th day.
2019-02-08 is: 6th week, 5th day.
2019-02-09 is: 6th week, 6th day.
2019-02-10 is: 6th week, 7th day.
2019-02-11 is: 7th week, 1th day.
2019-02-12 is: 7th week, 2th day.
2019-02-13 is: 7th week, 3th day.
2019-02-14 is: 7th week, 4th day.
2019-02-15 is: 7th week, 5th day.
2019-02-16 is: 7th week, 6th day.
2019-02-17 is: 7th week, 7th day.
2019-02-18 is: 8th week, 1th day.
2019-02-19 is: 8th week, 2th day.
2019-02-20 is: 8th week, 3th day.
2019-02-21 is: 8th week, 4th day.
2019-02-22 is: 8th week, 5th day.
2019-02-23 is: 8th week, 6th day.
2019-02-24 is: 8th week, 7th day.
2019-02-25 is: 9th week, 1th day.
2019-02-26 is: 9th week, 2th day.
2019-02-27 is: 9th week, 3th day.
2019-02-28 is: 9th week, 4th day.
2019-03-01 is: 9th week, 5th day.
2019-03-02 is: 9th week, 6th day.
2019-03-03 is: 9th week, 7th day.
2019-03-04 is: 10th week, 1th day.
2019-03-05 is: 10th week, 2th day.
2019-03-06 is: 10th week, 3th day.
2019-03-07 is: 10th week, 4th day.
2019-03-08 is: 10th week, 5th day.
2019-03-09 is: 10th week, 6th day.
2019-03-10 is: 10th week, 7th day.
2019-03-11 is: 11th week, 1th day.
2019-03-12 is: 11th week, 2th day.
2019-03-13 is: 11th week, 3th day.
2019-03-14 is: 11th week, 4th day.
2019-03-15 is: 11th week, 5th day.
2019-03-16 is: 11th week, 6th day.
2019-03-17 is: 11th week, 7th day.
2019-03-18 is: 12th week, 1th day.
2019-03-19 is: 12th week, 2th day.
2019-03-20 is: 12th week, 3th day.
2019-03-21 is: 12th week, 4th day.
2019-03-22 is: 12th week, 5th day.
2019-03-23 is: 12th week, 6th day.
2019-03-24 is: 12th week, 7th day.
2019-03-25 is: 13th week, 1th day.
2019-03-26 is: 13th week, 2th day.
2019-03-27 is: 13th week, 3th day.
2019-03-28 is: 13th week, 4th day.
2019-03-29 is: 13th week, 5th day.
2019-03-30 is: 13th week, 6th day.
2019-03-31 is: 13th week, 7th day.
2019-04-01 is: 14th week, 1th day.
2019-04-02 is: 14th week, 2th day.
2019-04-03 is: 14th week, 3th day.
2019-04-04 is: 14th week, 4th day.
2019-04-05 is: 14th week, 5th day.
2019-04-06 is: 14th week, 6th day.
2019-04-07 is: 14th week, 7th day.
2019-04-08 is: 15th week, 1th day.
2019-04-09 is: 15th week, 2th day.
2019-04-10 is: 15th week, 3th day.
2019-04-11 is: 15th week, 4th day.
2019-04-12 is: 15th week, 5th day.
2019-04-13 is: 15th week, 6th day.
2019-04-14 is: 15th week, 7th day.
2019-04-15 is: 16th week, 1th day.
2019-04-16 is: 16th week, 2th day.
2019-04-17 is: 16th week, 3th day.
2019-04-18 is: 16th week, 4th day.
2019-04-19 is: 16th week, 5th day.
2019-04-20 is: 16th week, 6th day.
2019-04-21 is: 16th week, 7th day.
2019-04-22 is: 17th week, 1th day.
2019-04-23 is: 17th week, 2th day.
2019-04-24 is: 17th week, 3th day.
2019-04-25 is: 17th week, 4th day.
2019-04-26 is: 17th week, 5th day.
2019-04-27 is: 17th week, 6th day.
2019-04-28 is: 17th week, 7th day.
2019-04-29 is: 18th week, 1th day.
2019-04-30 is: 18th week, 2th day.
2019-05-01 is: 18th week, 3th day.
2019-05-02 is: 18th week, 4th day.
2019-05-03 is: 18th week, 5th day.
2019-05-04 is: 18th week, 6th day.
2019-05-05 is: 18th week, 7th day.
2019-05-06 is: 19th week, 1th day.
2019-05-07 is: 19th week, 2th day.
2019-05-08 is: 19th week, 3th day.
2019-05-09 is: 19th week, 4th day.
2019-05-10 is: 19th week, 5th day.
2019-05-11 is: 19th week, 6th day.
2019-05-12 is: 19th week, 7th day.
2019-05-13 is: 20th week, 1th day.
2019-05-14 is: 20th week, 2th day.
2019-05-15 is: 20th week, 3th day.
2019-05-16 is: 20th week, 4th day.
2019-05-17 is: 20th week, 5th day.
2019-05-18 is: 20th week, 6th day.
2019-05-19 is: 20th week, 7th day.
2019-05-20 is: 21th week, 1th day.
2019-05-21 is: 21th week, 2th day.
2019-05-22 is: 21th week, 3th day.
2019-05-23 is: 21th week, 4th day.
2019-05-24 is: 21th week, 5th day.
2019-05-25 is: 21th week, 6th day.
2019-05-26 is: 21th week, 7th day.
2019-05-27 is: 22th week, 1th day.
2019-05-28 is: 22th week, 2th day.
2019-05-29 is: 22th week, 3th day.
2019-05-30 is: 22th week, 4th day.
2019-05-31 is: 22th week, 5th day.
2019-06-01 is: 22th week, 6th day.
2019-06-02 is: 22th week, 7th day.
2019-06-03 is: 23th week, 1th day.
2019-06-04 is: 23th week, 2th day.
2019-06-05 is: 23th week, 3th day.
2019-06-06 is: 23th week, 4th day.
2019-06-07 is: 23th week, 5th day.
2019-06-08 is: 23th week, 6th day.
2019-06-09 is: 23th week, 7th day.
2019-06-10 is: 24th week, 1th day.
2019-06-11 is: 24th week, 2th day.
2019-06-12 is: 24th week, 3th day.
2019-06-13 is: 24th week, 4th day.
2019-06-14 is: 24th week, 5th day.
2019-06-15 is: 24th week, 6th day.
2019-06-16 is: 24th week, 7th day.
2019-06-17 is: 25th week, 1th day.
2019-06-18 is: 25th week, 2th day.
2019-06-19 is: 25th week, 3th day.
2019-06-20 is: 25th week, 4th day.
2019-06-21 is: 25th week, 5th day.
2019-06-22 is: 25th week, 6th day.
2019-06-23 is: 25th week, 7th day.
2019-06-24 is: 26th week, 1th day.
2019-06-25 is: 26th week, 2th day.
2019-06-26 is: 26th week, 3th day.
2019-06-27 is: 26th week, 4th day.
2019-06-28 is: 26th week, 5th day.
2019-06-29 is: 26th week, 6th day.
2019-06-30 is: 26th week, 7th day.
2019-07-01 is: 27th week, 1th day.
2019-07-02 is: 27th week, 2th day.
2019-07-03 is: 27th week, 3th day.
2019-07-04 is: 27th week, 4th day.
2019-07-05 is: 27th week, 5th day.
2019-07-06 is: 27th week, 6th day.
2019-07-07 is: 27th week, 7th day.
2019-07-08 is: 28th week, 1th day.
2019-07-09 is: 28th week, 2th day.
2019-07-10 is: 28th week, 3th day.
2019-07-11 is: 28th week, 4th day.
2019-07-12 is: 28th week, 5th day.
2019-07-13 is: 28th week, 6th day.
2019-07-14 is: 28th week, 7th day.
2019-07-15 is: 29th week, 1th day.
2019-07-16 is: 29th week, 2th day.
2019-07-17 is: 29th week, 3th day.
2019-07-18 is: 29th week, 4th day.
2019-07-19 is: 29th week, 5th day.
2019-07-20 is: 29th week, 6th day.
2019-07-21 is: 29th week, 7th day.
2019-07-22 is: 30th week, 1th day.
2019-07-23 is: 30th week, 2th day.
2019-07-24 is: 30th week, 3th day.
2019-07-25 is: 30th week, 4th day.
2019-07-26 is: 30th week, 5th day.
2019-07-27 is: 30th week, 6th day.
2019-07-28 is: 30th week, 7th day.
2019-07-29 is: 31th week, 1th day.
2019-07-30 is: 31th week, 2th day.
2019-07-31 is: 31th week, 3th day.
2019-08-01 is: 31th week, 4th day.
2019-08-02 is: 31th week, 5th day.
2019-08-03 is: 31th week, 6th day.
2019-08-04 is: 31th week, 7th day.
2019-08-05 is: 32th week, 1th day.
2019-08-06 is: 32th week, 2th day.
2019-08-07 is: 32th week, 3th day.
2019-08-08 is: 32th week, 4th day.
2019-08-09 is: 32th week, 5th day.
2019-08-10 is: 32th week, 6th day.
2019-08-11 is: 32th week, 7th day.
2019-08-12 is: 33th week, 1th day.
2019-08-13 is: 33th week, 2th day.
2019-08-14 is: 33th week, 3th day.
2019-08-15 is: 33th week, 4th day.
2019-08-16 is: 33th week, 5th day.
2019-08-17 is: 33th week, 6th day.
2019-08-18 is: 33th week, 7th day.
2019-08-19 is: 34th week, 1th day.
2019-08-20 is: 34th week, 2th day.
2019-08-21 is: 34th week, 3th day.
2019-08-22 is: 34th week, 4th day.
2019-08-23 is: 34th week, 5th day.
2019-08-24 is: 34th week, 6th day.
2019-08-25 is: 34th week, 7th day.
2019-08-26 is: 35th week, 1th day.
2019-08-27 is: 35th week, 2th day.
2019-08-28 is: 35th week, 3th day.
2019-08-29 is: 35th week, 4th day.
2019-08-30 is: 35th week, 5th day.
2019-08-31 is: 35th week, 6th day.
2019-09-01 is: 35th week, 7th day.
2019-09-02 is: 36th week, 1th day.
2019-09-03 is: 36th week, 2th day.
2019-09-04 is: 36th week, 3th day.
2019-09-05 is: 36th week, 4th day.
2019-09-06 is: 36th week, 5th day.
2019-09-07 is: 36th week, 6th day.
2019-09-08 is: 36th week, 7th day.
2019-09-09 is: 37th week, 1th day.
2019-09-10 is: 37th week, 2th day.
2019-09-11 is: 37th week, 3th day.
2019-09-12 is: 37th week, 4th day.
2019-09-13 is: 37th week, 5th day.
2019-09-14 is: 37th week, 6th day.
2019-09-15 is: 37th week, 7th day.
2019-09-16 is: 38th week, 1th day.
2019-09-17 is: 38th week, 2th day.
2019-09-18 is: 38th week, 3th day.
2019-09-19 is: 38th week, 4th day.
2019-09-20 is: 38th week, 5th day.
2019-09-21 is: 38th week, 6th day.
2019-09-22 is: 38th week, 7th day.
2019-09-23 is: 39th week, 1th day.
2019-09-24 is: 39th week, 2th day.
2019-09-25 is: 39th week, 3th day.
2019-09-26 is: 39th week, 4th day.
2019-09-27 is: 39th week, 5th day.
2019-09-28 is: 39th week, 6th day.
2019-09-29 is: 39th week, 7th day.
2019-09-30 is: 40th week, 1th day.
2019-10-01 is: 40th week, 2th day.
2019-10-02 is: 40th week, 3th day.
2019-10-03 is: 40th week, 4th day.
2019-10-04 is: 40th week, 5th day.
2019-10-05 is: 40th week, 6th day.
2019-10-06 is: 40th week, 7th day.
2019-10-07 is: 41th week, 1th day.
2019-10-08 is: 41th week, 2th day.
2019-10-09 is: 41th week, 3th day.
2019-10-10 is: 41th week, 4th day.
2019-10-11 is: 41th week, 5th day.
2019-10-12 is: 41th week, 6th day.
2019-10-13 is: 41th week, 7th day.
2019-10-14 is: 42th week, 1th day.
2019-10-15 is: 42th week, 2th day.
2019-10-16 is: 42th week, 3th day.
2019-10-17 is: 42th week, 4th day.
2019-10-18 is: 42th week, 5th day.
2019-10-19 is: 42th week, 6th day.
2019-10-20 is: 42th week, 7th day.
2019-10-21 is: 43th week, 1th day.
2019-10-22 is: 43th week, 2th day.
2019-10-23 is: 43th week, 3th day.
2019-10-24 is: 43th week, 4th day.
2019-10-25 is: 43th week, 5th day.
2019-10-26 is: 43th week, 6th day.
2019-10-27 is: 43th week, 7th day.
2019-10-28 is: 44th week, 1th day.
2019-10-29 is: 44th week, 2th day.
2019-10-30 is: 44th week, 3th day.
2019-10-31 is: 44th week, 4th day.
2019-11-01 is: 44th week, 5th day.
2019-11-02 is: 44th week, 6th day.
2019-11-03 is: 44th week, 7th day.
2019-11-04 is: 45th week, 1th day.
2019-11-05 is: 45th week, 2th day.
2019-11-06 is: 45th week, 3th day.
2019-11-07 is: 45th week, 4th day.
2019-11-08 is: 45th week, 5th day.
2019-11-09 is: 45th week, 6th day.
2019-11-10 is: 45th week, 7th day.
2019-11-11 is: 46th week, 1th day.
2019-11-12 is: 46th week, 2th day.
2019-11-13 is: 46th week, 3th day.
2019-11-14 is: 46th week, 4th day.
2019-11-15 is: 46th week, 5th day.
2019-11-16 is: 46th week, 6th day.
2019-11-17 is: 46th week, 7th day.
2019-11-18 is: 47th week, 1th day.
2019-11-19 is: 47th week, 2th day.
2019-11-20 is: 47th week, 3th day.
2019-11-21 is: 47th week, 4th day.
2019-11-22 is: 47th week, 5th day.
2019-11-23 is: 47th week, 6th day.
2019-11-24 is: 47th week, 7th day.
2019-11-25 is: 48th week, 1th day.
2019-11-26 is: 48th week, 2th day.
2019-11-27 is: 48th week, 3th day.
2019-11-28 is: 48th week, 4th day.
2019-11-29 is: 48th week, 5th day.
2019-11-30 is: 48th week, 6th day.
2019-12-01 is: 48th week, 7th day.
2019-12-02 is: 49th week, 1th day.
2019-12-03 is: 49th week, 2th day.
2019-12-04 is: 49th week, 3th day.
2019-12-05 is: 49th week, 4th day.
2019-12-06 is: 49th week, 5th day.
2019-12-07 is: 49th week, 6th day.
2019-12-08 is: 49th week, 7th day.
2019-12-09 is: 50th week, 1th day.
2019-12-10 is: 50th week, 2th day.
2019-12-11 is: 50th week, 3th day.
2019-12-12 is: 50th week, 4th day.
2019-12-13 is: 50th week, 5th day.
2019-12-14 is: 50th week, 6th day.
2019-12-15 is: 50th week, 7th day.
2019-12-16 is: 51th week, 1th day.
2019-12-17 is: 51th week, 2th day.
2019-12-18 is: 51th week, 3th day.
2019-12-19 is: 51th week, 4th day.
2019-12-20 is: 51th week, 5th day.
2019-12-21 is: 51th week, 6th day.
2019-12-22 is: 51th week, 7th day.
2019-12-23 is: 52th week, 1th day.
2019-12-24 is: 52th week, 2th day.
2019-12-25 is: 52th week, 3th day.
2019-12-26 is: 52th week, 4th day.
2019-12-27 is: 52th week, 5th day.
2019-12-28 is: 52th week, 6th day.
2019-12-29 is: 52th week, 7th day.
2019-12-30 is: 1th week, 1th day.
2019-12-31 is: 1th week, 2th day.

我们队2019年全年的每一天都做了一个计算,上面是所有的输出结果,那么如何来验证计算的是否正确呢?这里我们以今天为例进行验证,从电脑右下角的日期得知今天是周三:

我们代码的计算结果如下:

核对无误,至于今天是一年的第几周这个感兴趣的话也是可以从电脑右下角的日历里面数一数的,我数了一下的确是一年的第31周,你数过了吗?

相关推荐

为何越来越多的编程语言使用JSON(为什么编程)

JSON是JavascriptObjectNotation的缩写,意思是Javascript对象表示法,是一种易于人类阅读和对编程友好的文本数据传递方法,是JavaScript语言规范定义的一个子...

何时在数据库中使用 JSON(数据库用json格式存储)

在本文中,您将了解何时应考虑将JSON数据类型添加到表中以及何时应避免使用它们。每天?分享?最新?软件?开发?,Devops,敏捷?,测试?以及?项目?管理?最新?,最热门?的?文章?,每天?花?...

MySQL 从零开始:05 数据类型(mysql数据类型有哪些,并举例)

前面的讲解中已经接触到了表的创建,表的创建是对字段的声明,比如:上述语句声明了字段的名称、类型、所占空间、默认值和是否可以为空等信息。其中的int、varchar、char和decimal都...

JSON对象花样进阶(json格式对象)

一、引言在现代Web开发中,JSON(JavaScriptObjectNotation)已经成为数据交换的标准格式。无论是从前端向后端发送数据,还是从后端接收数据,JSON都是不可或缺的一部分。...

深入理解 JSON 和 Form-data(json和formdata提交区别)

在讨论现代网络开发与API设计的语境下,理解客户端和服务器间如何有效且可靠地交换数据变得尤为关键。这里,特别值得关注的是两种主流数据格式:...

JSON 语法(json 语法 priority)

JSON语法是JavaScript语法的子集。JSON语法规则JSON语法是JavaScript对象表示法语法的子集。数据在名称/值对中数据由逗号分隔花括号保存对象方括号保存数组JS...

JSON语法详解(json的语法规则)

JSON语法规则JSON语法是JavaScript对象表示法语法的子集。数据在名称/值对中数据由逗号分隔大括号保存对象中括号保存数组注意:json的key是字符串,且必须是双引号,不能是单引号...

MySQL JSON数据类型操作(mysql的json)

概述mysql自5.7.8版本开始,就支持了json结构的数据存储和查询,这表明了mysql也在不断的学习和增加nosql数据库的有点。但mysql毕竟是关系型数据库,在处理json这种非结构化的数据...

JSON的数据模式(json数据格式示例)

像XML模式一样,JSON数据格式也有Schema,这是一个基于JSON格式的规范。JSON模式也以JSON格式编写。它用于验证JSON数据。JSON模式示例以下代码显示了基本的JSON模式。{"...

前端学习——JSON格式详解(后端json格式)

JSON(JavaScriptObjectNotation)是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScriptProgrammingLa...

什么是 JSON:详解 JSON 及其优势(什么叫json)

现在程序员还有谁不知道JSON吗?无论对于前端还是后端,JSON都是一种常见的数据格式。那么JSON到底是什么呢?JSON的定义...

PostgreSQL JSON 类型:处理结构化数据

PostgreSQL提供JSON类型,以存储结构化数据。JSON是一种开放的数据格式,可用于存储各种类型的值。什么是JSON类型?JSON类型表示JSON(JavaScriptO...

JavaScript:JSON、三种包装类(javascript 包)

JOSN:我们希望可以将一个对象在不同的语言中进行传递,以达到通信的目的,最佳方式就是将一个对象转换为字符串的形式JSON(JavaScriptObjectNotation)-JS的对象表示法...

Python数据分析 只要1分钟 教你玩转JSON 全程干货

Json简介:Json,全名JavaScriptObjectNotation,JSON(JavaScriptObjectNotation(记号、标记))是一种轻量级的数据交换格式。它基于J...

比较一下JSON与XML两种数据格式?(json和xml哪个好)

JSON(JavaScriptObjectNotation)和XML(eXtensibleMarkupLanguage)是在日常开发中比较常用的两种数据格式,它们主要的作用就是用来进行数据的传...

取消回复欢迎 发表评论:

请填写验证码