Tag Archives: distutils

One more Tool

It’s days like today that remind me how much I have yet to learn. Such days are frustrating because they keep me from making tangible progress on the game, but they usually teach me something valuable that will come into play later. Today, it was distutils.

About a month ago I started developing a menu object that I’ll be able to carry with me from game to game. It’s a sweet little piece—if I do say so myself—with the ability to set wrapping or not, pick custom music, use either text to speech or sounds, and a lot of other things. When Chris looked it over, though, he pointed out some of its immediately apparent errors. One of the most glaring was the fact that the menu code lacks any kind of support for sub-menus.

Chris incorporated my existing code into a package that we will be able to install directly into our respective python libraries, and we have since started working to improve it. However, upon downloading the package to start debugging it today, I realized that I have no idea how to read a package. Why is there a dist folder? Why is there a build folder? Why is there a lib folder? Why are there two versions of the code, and which one should I be modifying?

To answer these questions I went on a Google hunt, and I eventually came across the distutils manual, a detailed document explaining more than I ever could have hoped to learn about packaging and installing Python modules. The technical nature of the document, however, forced me to run a bunch of secondary Google searches to figure out what the heck I was reading about. It’s like being stuck inside a giant see-also loop in the dictionary.

The end result is that I’m a bit smarter than I was before, and I have a better idea of what is required to put together reusable code, but it also means my development was on hold for a bit today. On the bright side, I won’t have to learn this again, and I now have one more tool in my toolbox.