我在其中一张Excel表格中打印了一些公式:
wsOld.cell(row = 1, column = 1).value = "=B3=B4"
Run Code Online (Sandbox Code Playgroud)
但我不能将其结果用于实现其他逻辑,如:
if((wsOld.cell(row=1, column=1).value)='true'):
# copy the 1st row to another sheet
Run Code Online (Sandbox Code Playgroud)
即使我试图在命令行中打印结果,我最终打印公式:
>>> print(wsOld.cell(row=1, column=1))
>>> =B3=B4
Run Code Online (Sandbox Code Playgroud)
如何在单元格中获得公式的结果而不是公式本身?
AWS S3 的“ResourceLoader”可以很好地处理这些属性:
\ncloud:\n aws:\n s3:\n endpoint: s3.amazonaws.com <-- custom endpoint added in spring cloud aws 2.3\n credentials:\n accessKey: XXXXXX\n secretKey: XXXXXX\n region:\n static: us-east-1\n stack:\n auto: false\nRun Code Online (Sandbox Code Playgroud)\n但是,当我在本地启动 localstack 容器并尝试将其与这些属性一起使用时(根据此发行文档:https ://spring.io/blog/2021/03/17/spring-cloud-aws-2-3 -现在可用):
\ncloud:\n aws:\n s3:\n endpoint: http://localhost:4566\n credentials:\n accessKey: test\n secretKey: test\n region:\n static: us-east-1\n stack:\n auto: false\nRun Code Online (Sandbox Code Playgroud)\n我得到这个例外:
\n\n17:12:12.130 [reactor-http-nio-2] 错误 org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler - [23efd000-1] 500 HTTP GET“/getresource/test”\ncom 服务器错误.amazonaws.SdkClientException:无法执行 HTTP 请求:mybucket.localhost\nat com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1207) ~[aws-java-sdk-core-1.11.951.jar: ?]\n抑制:reactor.core.publisher.FluxOnAssembly$OnAssemblyException:\n在以下站点观察到错误:\n|_ checkpoint \xe2\x87\xa2 org.springframework.boot.actuate.metrics.web .reactive.server.MetricsWebFilter [DefaultWebFilterChain]\n|_ 检查点 \xe2\x87\xa2 …