0

If I were to do the following:

(setv a/b 12)

How would I access the variable in Python, such as from a regular python module, or simply using (py)?

(py "print(a/b)")
ShadowRylander
  • 361
  • 2
  • 8

1 Answers1

1

With mangling:

=> (setv a/b 12)
=> a/b
12
=> (hy.mangle "a/b")
"hyx_aXsolidusXb"
=> hyx_aXsolidusXb
12
=> (py "print(hyx_aXsolidusXb)")
12
=> (py "print(globals()[hy.mangle('a/b')])")
12
Kodiologist
  • 2,984
  • 18
  • 33