如何将变量值传递给另一个配置参数?

2024-09-29 01:29:31 发布

您现在位置:Python中文网/ 问答频道 /正文

[plugin_jira]
maxuser=
finduser=
endpoint="https://nepallink.atlassian.net/rest/api/latest/user/search?startAt=0&maxResults={maxi}&username={manche}%".format(maxi=maxresult,manche=user_find)

这是我的配置文件,在endpoints项中,我之所以使用格式是为了在脚本。那个运行的脚本如下,my主.py

^{pr2}$

现在我感到困惑的是,当我调用脚本中的端点值时,它只是获取配置中的内容,而没有在其上方定义的变量值。在

如何将maxresultuser_find的变量值添加到定义为访问它的端点。在


Tags: https脚本定义jirafind端点pluginendpoint
1条回答
网友
1楼 · 发布于 2024-09-29 01:29:31

在配置文件中,从main.py导入变量,如下所示。在

配置文件:


from main import maxresult, user_find
[plugin_jira]
endpoint="https://nepallink.atlassian.net/rest/api/latest/user/search?startAt=0&maxResults={maxi}&username={manche}%".format(maxi=maxresult,manche=user_find)

这将允许您访问端点所需的变量。在

希望有帮助!在

相关问题 更多 >