我正在尝试运行异步函数,该函数将调用常规函数
我试过这个:
import asyncio
from okta.client import Client as OktaClient
def startFunc(metadataURL,appID):
print("This is the",metadataURL, appID)
config = {
'orgUrl': 'https://example.com',
'token': 'myToken'}
okta_client = OktaClient(config)
async def skipFunc():
apps, resp, err = await okta_client.list_applications()
for app in apps:
appsList = (app.label,app.id)
for app.label in appsList:
if app.label == 'John':
strApp = str(app)
appJson = ast.literal_eval(strApp)
metadataURL = (appJson['links']['metadata']['href'])
appID = (appJson['id'])
startFunc(metadataURL,appID) ## Trying to call this function
loop = asyncio.get_event_loop()
loop.run_until_complete(skipFunc())
我没有收到输出,看起来函数startFunc()没有执行,我没有收到任何错误
希望你能帮助我
目前没有回答
相关问题 更多 >
编程相关推荐