laptop and a wrench

Erro

The Calculate Field tool results in a NameError exception when using Python variables.

Última Publicação: October 28, 2015 ArcGIS for Desktop
Número de ID do Erro BUG-000091442
EnviadoOctober 15, 2015
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS for Desktop
Versão encontrada10.2.2
Sistema OperacionalWindows OS
Versão do Sistema Operacional7.0 64 Bit
StatusKnown Limit

Informações Adicionais

Changes were made around 10.2.2 to properly isolate script tool code, validation and tool like Calculate Field and Calculate Value that use Python internally. Prior to this change, there was potential for confusing and unexpected issues that would be hard to isolate because a variable could be changed in one tool that would impact another tool. The best strategy for passing variables into CalculateField is using string formatting as shown in the workaround.

Solução Provisória

Use the following code:arcpy.CalculateField_management(table,"gayu", "({0} + 1) / 2".format(funcg), "PYTHON", "")

Etapas para Reproduzir

ID do Erro: BUG-000091442

Software:

  • ArcGIS for Desktop

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download