第二次使用`event, values = window.读取时键消失 PySimpleGUI 中的 read() `

如何解决第二次使用`event, values = window.读取时键消失 PySimpleGUI 中的 read() `

当我第二次使用 { "personalizations": [ { "to": [ { "email": "abc@abc.com","name": "abc abc" } ],"dynamic_template_data": { "otp": "123456","subject": "account email verification code",},} ],"from": { "email": "noreply@johndoe.com","name": "John Doe" },"reply_to": { "email": "noreply@johndoe.com","template_id": "d-xxxxxxxxxxxxxxxxxxxxxxxx" } 时,我在 <!--Step 1 SendGrid Email--> <ClaimType Id="Otp"> <displayName>Secondary One-time password</displayName> <DataType>string</DataType> </ClaimType> <ClaimType Id="emailRequestBody"> <displayName>SendGrid request body</displayName> <DataType>string</DataType> </ClaimType> <ClaimType Id="VerificationCode"> <displayName>Secondary Verification Code</displayName> <DataType>string</DataType> <UserHelpText>Enter your email verification code</UserHelpText> <UserInputType>TextBox</UserInputType> </ClaimType> <!--Step 1--> <!--Step 2 SendGrid Email To be worked on --> <ClaimsTransformation Id="GenerateEmailRequestBody" TransformationMethod="GenerateJson"> <InputClaims> <InputClaim ClaimTypeReferenceId="email" TransformationClaimType="personalizations.0.to.0.email" /> <InputClaim ClaimTypeReferenceId="otp" TransformationClaimType="personalizations.0.dynamic_template_data.otp" /> <InputClaim ClaimTypeReferenceId="email" TransformationClaimType="personalizations.0.dynamic_template_data.email" /> </InputClaims> <InputParameters> <!-- Update the template_id value with the ID of your SendGrid template. --> <InputParameter Id="template_id" DataType="string" Value="d-xxxxxxxxxxxxxxxxxxxxxxxxxx"/> <InputParameter Id="from.email" DataType="string" Value="my_email@mydomain.com"/> <!-- Update with a subject line appropriate for your organization. --> <InputParameter Id="personalizations.0.dynamic_template_data.subject" DataType="string" Value="account email verification code"/> </InputParameters> <OutputClaims> <OutputClaim ClaimTypeReferenceId="emailRequestBody" TransformationClaimType="outputClaim"/> </OutputClaims> </ClaimsTransformation> <!--Step 2--> <!--Step 3 SendGrid Email--> <ContentDeFinition Id="api.localaccountsignup"> <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.0</DataUri> </ContentDeFinition> <ContentDeFinition Id="api.localaccountpasswordreset"> <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.0</DataUri> </ContentDeFinition> <!--Step 3--> <!--Step 4 SendGrid Email--> <displayControls> <displayControl Id="emailVerificationControl" UserInterfaceControlType="VerificationControl"> <displayClaims> <displayClaim ClaimTypeReferenceId="email" required="true" /> <displayClaim ClaimTypeReferenceId="verificationCode" ControlClaimType="VerificationCode" required="true" /> </displayClaims> <OutputClaims> <OutputClaim ClaimTypeReferenceId="email" /> </OutputClaims> <Actions> <Action Id="SendCode"> <ValidationClaimsExchange> <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="GenerateOtp" /> <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SendOtp" /> </ValidationClaimsExchange> </Action> <Action Id="VerifyCode"> <ValidationClaimsExchange> <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="VerifyOtp" /> </ValidationClaimsExchange> </Action> </Actions> </displayControl> </displayControls> <!--Step 4--> <!--Step 5 SendGrid Email--> <ClaimsProvider> <displayName>One time password technical profiles</displayName> <TechnicalProfiles> <TechnicalProfile Id="GenerateOtp"> <displayName>Generate one time password</displayName> <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider,Web.TPEngine,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" /> <Metadata> <Item Key="Operation">GenerateCode</Item> <Item Key="CodeExpirationInSeconds">1200</Item> <Item Key="CodeLength">6</Item> <Item Key="CharacterSet">0-9</Item> <Item Key="ReuseSameCode">true</Item> <Item Key="NumRetryAttempts">5</Item> </Metadata> <InputClaims> <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="identifier" /> </InputClaims> <OutputClaims> <OutputClaim ClaimTypeReferenceId="otp" PartnerClaimType="otpGenerated" /> </OutputClaims> </TechnicalProfile> <TechnicalProfile Id="VerifyOtp"> <displayName>Verify one time password</displayName> <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider,PublicKeyToken=null" /> <Metadata> <Item Key="Operation">VerifyCode</Item> </Metadata> <InputClaims> <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="identifier" /> <InputClaim ClaimTypeReferenceId="verificationCode" PartnerClaimType="otpToVerify" /> </InputClaims> </TechnicalProfile> </TechnicalProfiles> </ClaimsProvider> <!--Step 5--> <!--Step 6 SendGrid Email--> <ClaimsProvider> <displayName>RestfulProvider</displayName> <TechnicalProfiles> <TechnicalProfile Id="SendOtp"> <displayName>Use SendGrid's email API to send the code the the user</displayName> <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider,PublicKeyToken=null" /> <Metadata> <Item Key="ServiceUrl">https://api.sendgrid.com/v3/mail/send</Item> <Item Key="AuthenticationType">Bearer</Item> <Item Key="SendClaimsIn">Body</Item> <Item Key="ClaimUsedForRequestPayload">emailRequestBody</Item> </Metadata> <CryptographicKeys> <Key Id="BearerAuthenticationToken" StorageReferenceId="B2C_1A_SendGridSecret" /> </CryptographicKeys> <InputClaimsTransformations> <InputClaimsTransformation ReferenceId="GenerateEmailRequestBody" /> </InputClaimsTransformations> <InputClaims> <InputClaim ClaimTypeReferenceId="emailRequestBody" /> </InputClaims> </TechnicalProfile> </TechnicalProfiles> </ClaimsProvider> <!--Step 6--> <!--Step 7 SendGrid Email--> <ClaimsProvider> <displayName>Local Account</displayName> <TechnicalProfiles> <TechnicalProfile Id="LocalAccountSignUpWithlogonEmail"> <Metadata> <!--OTP validation error messages--> <Item Key="UserMessageIfSessionDoesNotExist">You have exceeded the maximum time allowed.</Item> <Item Key="UserMessageIfMaxRetryAttempted">You have exceeded the number of retries allowed.</Item> <Item Key="UserMessageIfInvalidCode">You have entered the wrong code.</Item> <Item Key="UserMessageIfSessionConflict">Cannot verify the code,please try again later.</Item> </Metadata> <displayClaims> <displayClaim displayControlReferenceId="emailVerificationControl" /> <displayClaim ClaimTypeReferenceId="displayName" required="true" /> <displayClaim ClaimTypeReferenceId="givenname" required="true" /> <displayClaim ClaimTypeReferenceId="surName" required="true" /> <displayClaim ClaimTypeReferenceId="newPassword" required="true" /> <displayClaim ClaimTypeReferenceId="reenterPassword" required="true" /> </displayClaims> </TechnicalProfile> <TechnicalProfile Id="LocalAccountdiscoveryUsingEmailAddress"> <Metadata> <!--OTP validation error messages--> <Item Key="UserMessageIfSessionDoesNotExist">You have exceeded the maximum time allowed.</Item> <Item Key="UserMessageIfMaxRetryAttempted">You have exceeded the number of retries allowed.</Item> <Item Key="UserMessageIfInvalidCode">You have entered the wrong code.</Item> <Item Key="UserMessageIfSessionConflict">Cannot verify the code,please try again later.</Item> </Metadata> <displayClaims> <displayClaim displayControlReferenceId="emailVerificationControl" /> </displayClaims> </TechnicalProfile> </TechnicalProfiles> </ClaimsProvider> <!--Step 7--> 中为 event,values = window.read()'IN1' 设置的键 'IN2'sg.InputText(key='IN1')不复存在。实际上 sg.Filebrowse(key='IN2',file_types= (('EXCEL FILES','*.xlsx'),)) 变成了 layout 。如何设置键以使它们不会消失?我不希望 values 变成None,我希望保留密钥。谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?