So the people in my world has had major boons I technology from ancient tech artifacts and one of the major ones are space elevators which each planet (including floating habitats on gas giants). Due to this they have very easy access to space. Their average tech level is roughly mid world war 2, nuclear reactors aren’t an option. Oil and Coal are very rare if non existent and the civilization uses wood gas to power combustion engines in cars and other vehicles. So far I think my two major choices are between some sort of self sufficient boiler system (self sufficient in that it condenses the water it boils) or just a large combustion engine, both would turn a generator to produce power. I’m looking for something to create electricity, not thrust for the ships themselves (the ships use hydrogen for rockets siphoned from the atmosphere of a gas giant). I’d rather not use solar panels because I feel like that is a rather modern technology but I’m not totally opposed if they were present in that time period. The world isn’t perfectly parallel with WW 2 level tech so it’s ok if some ideas deviate slightly form the tech of that time.
Hydrogen fuel cells
The first Hydrogen-Oxygen fuel cell was invented in 1932. They were one of the main sources of electricity, heat and water for the crews on the Apollo missions to the Moon (Apollo 13 was a failure when they lost the fuel cells).
So if they have Hydrogen freely available, then that is your answer for not just electricity but the other important "hotel services" of heat and water.