我认为import json
import sys
import requests
url = "https://npiregistry.cms.hhs.gov/api/?number=&enumeration_type=&taxonomy_description=&first_name=&last_name=&organization_name=&address_purpose=&city=&state=&postal_code=10017&country_code=&limit=&skip="
htmlfile=requests.get(url)
data = htmlfile.json()
for i in data["results"]:
print(i)
是异步运行的,如何在执行代码之后等待它完成?
像,
$state.reload()
$state.reload();
futureFunc();
不适合我。
答案 0 :(得分:0)
您将在$ state.go
中获得回调所以,做这样的事情
$state.go('wherever', {whenever: 'whatever'}).then(function() {
// Get in a spaceship and fly to Jupiter, or whatever your callback does.
});