Home python How to transfer to the godot variable from a Python script in...

How to transfer to the godot variable from a Python script in the godot script

Author

Date

Category

There are two scripts – one .gd, second .py

From .py I need only variables (string, numeric, lists, dictionaries),
They need to pick up (import) in .gd

How can I do this?

Example scriptpy.py (singleton)

a = 'hello'
B = 3.

Example scriptgd.gd

var t = scriptpy.a
var i = scriptpy.b
Print (T) # does not work
Print (i) # does not work

Answer 1

Google said that the one is a variety of language S.
So there is an embedding of Python in Godot, but this … not realizable …
Therefore, I propose simply writing to a file \ base of interest of the variables

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions