官术网_书友最值得收藏!

Exploring the main() function

The main() function is relatively simple. First, on line 48 we call the get_address() function and store the result in a variable named raw_account. This variable contains our JSON-formatted transaction data. In order to manipulate this data, we use the json.loads() function to deserialize the JSON data and store it in the account variable. At this point, our account variable is a series of dictionaries and lists that we can begin to traverse, which is exactly what we do in the print_transactions() function called on line 50:

042 def main(address):
043 """
044 The main function handles coordinating logic
045 :param address: The Bitcoin Address to lookup
046 :return: Nothing
047 """
048 raw_account = get_address(address)
049 account = json.loads(raw_account.read())
050 print_transactions(account)
主站蜘蛛池模板: 林口县| 易门县| 馆陶县| 永仁县| 楚雄市| 个旧市| 双流县| 汪清县| 拉萨市| 新余市| 高邑县| 无锡市| 娱乐| 芒康县| 乌兰县| 平顺县| 常宁市| 永平县| 南开区| 万源市| 武陟县| 石泉县| 靖州| 宁河县| 视频| 阜康市| 清水河县| 江山市| 吴桥县| 北票市| 安吉县| 福安市| 亳州市| 阜南县| 临澧县| 尤溪县| 平遥县| 格尔木市| 美姑县| 资阳市| 云梦县|