Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google电子表格和Python-如何使用gspread生成双引号JSON_Python_Json_Python 3.x_Google Sheets_Gspread - Fatal编程技术网

Google电子表格和Python-如何使用gspread生成双引号JSON

Google电子表格和Python-如何使用gspread生成双引号JSON,python,json,python-3.x,google-sheets,gspread,Python,Json,Python 3.x,Google Sheets,Gspread,我正在尝试使用gspread将google电子表格转换为JSON数据 我找到了这个博客,能够生成一段JSON数据。但是,数据用单引号包装 由于JSON标准需要双引号,我需要一种方法来实现它 我知道使用str.replace将单引号替换为双引号是一种解决方案,但有时我的单元格包含单引号的内容,因此单元格中的引号也会被替换,这不是正确的做法 备注:我正在使用Python3,我需要我的电子表格是私有的

我正在尝试使用gspread将google电子表格转换为JSON数据

我找到了这个博客,能够生成一段JSON数据。但是,数据用单引号包装

由于JSON标准需要双引号,我需要一种方法来实现它

我知道使用str.replace将单引号替换为双引号是一种解决方案,但有时我的单元格包含单引号的内容,因此单元格中的引号也会被替换,这不是正确的做法

备注:我正在使用Python3,我需要我的电子表格是私有的