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

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)
主站蜘蛛池模板: 鄂伦春自治旗| 祁阳县| 长宁区| 定南县| 铜鼓县| 土默特右旗| 措勤县| 平湖市| 普定县| 长治县| 宝丰县| 江川县| 西乌| 山东省| 刚察县| 三穗县| 无棣县| 万山特区| 梁河县| 新津县| 浮山县| 濮阳县| 炉霍县| 遵义市| 贵溪市| 郧西县| 旌德县| 河津市| 裕民县| 阿克苏市| 体育| 东阿县| 黑山县| 顺平县| 突泉县| 防城港市| 交城县| 襄樊市| 竹北市| 洛川县| 烟台市|