cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

MetaData variables in Python XMC scripts

MetaData variables in Python XMC scripts

StephanH
Valued Contributor III
Hello all,

how is the correct value assignement for variables in the META section of an python script?

TCL scripts show's like these:

#@ScriptDescription "Copy config while onboarding"
#@SectionStart (description = "Select configuration" )
#
#@VariableFieldLabel (description = "ConfigName"
# type = String
# scope = device
# )
set var ConfigName ""
#@SectionEnd

How do you have to replace set var ConfigName "" in python?
If I try ConfigName = "" the Device Settings section is empty if I run the script.

So what is the correct syntax?

Best regards
Stephan

Regards Stephan
1 REPLY 1

StephanH
Valued Contributor III
Hello,

here is the working solution for my problem for the sake of completeness:

#@VariableFieldLabel (description = "ConfigName",
# type = String,
# scope = global
# )
set var ConfigName

#To use the variable
configfile = emc_vars["ConfigName"]


Best regards
Stephan

Regards Stephan
GTM-P2G8KFN