Question: program that would allow merge two python or xml files in one

Isotope

Warlord
Joined
Dec 23, 2008
Messages
136
Hello.
I have several modmods for Fall from Heaven that I want to merge (thankfully, one of them does not have any dlls). That means that I'll have to combine several files (CvEventManager.py or xml files) is there a program that automatically compares two files and merges them in one that contains the information from one and the other one (the content from one is appended to the other one)?
Thanks.
 
Hello.
I have several modmods for Fall from Heaven that I want to merge (thankfully, one of them does not have any dlls). That means that I'll have to combine several files (CvEventManager.py or xml files) is there a program that automatically compares two files and merges them in one that contains the information from one and the other one (the content from one is appended to the other one)?
Thanks.

Winmerge will allow you to merge XML files. I'm not sure about how to go about merging python files though.
 
WinMerge does work with python, although I've found that it often messes up indentation. I would recommend using IDLE to check for syntax errors after merging files in WinMerge, although IDLE isn't very good for actually corrected the errors it finds, just for finding the line where the bug is. Notepad2 or Notepad++ should be used for actually fixing them.

WinMerge -> IDLE -> Notepad2/++ is what I would recommend.


Winmerge doesn't actually merge things automatically, it finds differences and lets you move things from one file to the other (and makes backups of the unmodified files). I'm not sure I'd ever trust a fully automated merging program.
 
WinMerge does work with python, although I've found that it often messes up indentation. I would recommend using IDLE to check for syntax errors after merging files in WinMerge, although IDLE isn't very good for actually corrected the errors it finds, just for finding the line where the bug is. Notepad2 or Notepad++ should be used for actually fixing them.
I found two "IDLE": "Integrated DeveLopment Environment" and "The IDLE Scripting Language"
http://idle.thomaslauer.com/index.html
http://www.python.org/idle/doc/idle2.html
Are they the same?
 
Maybe. I'm quite sure. The one I use came with the visual python program we used in Physics a year and a half ago to model electromagnetic fields. It is actually for python 2.5, while Civ IV uses Python 2.4. I think that 2.5 might be slightly more picky about some things, as Kael often gets away with using multiple spaces instead of tabs, but using spaces instead of of before tabs makes the IDLE I use for debugging go crazy.
 
It is almost certainly the one that comes with Python people mean when they say IDLE. If all you're going to do is mod Civ IV, it would probably be a good idea to install python 2.4, rather than the latest version, 2.6. (Python 3.0 is out too, but it is a concurrent version with 2.6 that makes some changes to the language.) The only real difference between 2.4, 2.5 and 2.6 is a few extra features in the later versions. And "with" is a keyword in 2.6 .

But like MagisterCultuum says, IDLE isn't very good. I think it's just bundled with python because there needs to be some editor in the installation. I use Stani's Python Editor, although it can be comparatively difficult to install.

SPE is more restrictive than python about indentation though, it complains if any tab size produces different indentation. So <space><tab> followed by <tab>, results in complaint because it produced different indentation at tab size 1.

Python, all versions, uses a tab size of 8. In my opinion allowing tabs and spaces to be mixed is the biggest flaw in python. So good editors complain if you do.
 
Thanks a lot for all the information, it seems I'll need a some time to get used to theese programs.
 
I don't want to start another thread.. Where can I find something to edit python..
 
OK,thanks
 
Top Bottom