Python Development

From FreeOrionWiki
Revision as of 23:24, 19 February 2015 by Cjkjvfnby (Talk | contribs)

Jump to: navigation, search

This page will be devoted to matters relating to python development in general for the FreeOrion project, including the boost::python interface. Topics relating more specifically to the AI will be covered at AI_Development, and topics relating more specifically to universe creation will be covered at Universe_Creation.


Python editor

It is you choice how to edit python code. Here is some suggestions:

- PyCharm community edition

- Eclipse based.

Main feature that you need is navigate to declaration with CTRL+CLICK. Good IDE will help you to make less mistake. Using keyboard shortcuts greatly speedup your development.


Deploying code

Possible approaches:

 a) configure game to use AI from your repository folder. (this is best!)
 b) copy code to game folder
 c) edit code in game folder and copy it back to repo

FAQ

- Q: This page can be better / has typo / ...
- A: Welcome to forum, lets do it better.
- Q: which python version used?
- A: Windows: python shipped with game(2.7.3) Other system use system python.
- Q: Witch version is supported by AI and universe generation?  
- A: 2.7 
- Q: Where print goes?
- A: stdout and stderr redirected to logs in game settings folder (APPDATA/Roaming/FreeOrion/AI_*.log, ~/.freorion/AI_*.log)
- Q: how to test new code?
- A: start/load game (changing code during gameplay will not get result, code is already in memory)