python-sc2 icon indicating copy to clipboard operation
python-sc2 copied to clipboard

_host_game_iter is pointless unless all the modules are reloaded

Open RZarifov opened this issue 4 years ago • 1 comments

In the given example of fast reload we're reloading the code of example bot, and it works.
Until you decide to split the code in multiple modules, and python's reload function of importlib module works in a way that it only reloads the module it is pointed at, ignoring all the imports, parent classes this module depends on.
So it is perhaps a python issue, but until we find the working solution to reload all the modules within the bot, the example is useless.

RZarifov avatar Oct 10 '20 17:10 RZarifov

The way it should work, as I see it:
it should generate the config, or user should create a config, with predefined ports, etc, and you leave sc2 process alone, after launching it, yet you always start python process from scratch, not reload some modules, and python connects to the sc2 instance and it knows what it should connect to by reading the config file.

RZarifov avatar Oct 10 '20 18:10 RZarifov