How to import data from other files within a .k file? #1809
-
How can I import data from another .k-file within a .k-file? The normal import seems to target schemas only. I haven't figured out yet how to import other data that is defined in kcl. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
import can import data
b.k
Is this what you want? If you have any other questions, please give me more information. |
Beta Was this translation helpful? Give feedback.
-
If you want to enforce data type with a schema, you can define the data object
In the design of KCL, normal "variables" are all exported variables, and exported variables are immutable. So you can't
and
Does this solve your problem? |
Beta Was this translation helpful? Give feedback.
-
Thank you. I think your method is something I can get by with. |
Beta Was this translation helpful? Give feedback.
If you want to enforce data type with a schema, you can define the data object
In the design of KCL, normal "variables" are all exported variables, and exported variables are immutable. So you can't
config = config.config
.In addition, if you don't want to output config in the result, but reference it elsewhere, you can add the prefix '_'. So you can modify the code
and
Does this solve your problem?