Skip to content

Commit

Permalink
Update demo.py
Browse files Browse the repository at this point in the history
重新格式化自己这部分的代码
  • Loading branch information
xiyihan0 authored Dec 10, 2023
1 parent 319de17 commit 2544195
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,16 @@ def appapi_novel(aapi):
print("Total comments = {}".format(json_result["total_comments"]))
for comment in json_result["comments"]:
if comment["parent_comment"]:
print("{user} replied to {target} at {time} : {content}".format(user = comment["user"]["name"], time = comment["date"], content = comment["comment"], target = comment["parent_comment"]["user"]["name"]))
print("{user} replied to {target} at {time} : {content}".format(
user = comment["user"]["name"],
time = comment["date"],
content = comment["comment"],
target = comment["parent_comment"]["user"]["name"]))
else:
print("{user} at {time} : {content}".format(user=comment["user"]["name"], time=comment["date"], content=comment["comment"]))
print("{user} at {time} : {content}".format(
user=comment["user"]["name"],
time=comment["date"],
content=comment["comment"]))



Expand Down

0 comments on commit 2544195

Please sign in to comment.