This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 导入pandas库 | |
import pandas as pd | |
# 导入sys库,用来获取命令行参数 | |
import sys | |
# 定义一个函数,用来将JSON文件转换成Excel文件 | |
def convert_json_to_excel(json_file, excel_file): | |
# 使用read_json方法,读取JSON文件,并创建一个DataFrame对象 | |
df = pd.read_json(json_file) | |
# 使用to_excel方法,将DataFrame对象保存成Excel文件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 导入所需的库 | |
import bson | |
import json | |
import datetime | |
# 定义一个类,继承自json库的JSONEncoder类 | |
class BSONEncoder(json.JSONEncoder): | |
# 重写default方法,用来处理BSON中的datetime对象 | |
def default(self, obj): | |
# 如果对象是datetime类型,就返回它的年月日字符串 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package au.id.alexn; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.MotionEvent; | |
import android.view.ScaleGestureDetector; | |
import android.view.View; | |
import android.widget.FrameLayout; |