/* jquery */ /* jquery accordion style*/ /* jquery init */

27 October 2014

Python 2 to 3 Conversion Tips

Even a well loved language like Python has its downsides.
One tricky issue is that there are two main Python versions, namely 2 and 3.
And, unfortunately, version 2 code often fails to run in a Python 3 environment, and visa versa.

So here's my quick guide.

Key Elements

The focus of your conversion efforts should be on:
• print and print()
• exception handling
• module import errors
• integer handling
• unicode characters
• using bytes

There's a very helpful guide on each of this topics at the Python 3 porting site.
And more useful information can be found on this blog page from Alexandre Vassalotti.

No Conversion Required

Do you want to create code that works in both versions?
Then head over to the no conversion chapter and find out how the Six utility works its magic.

More Raspberry Pi Python Coding Tutorials

1 October 2014

Microsoft and Minecraft: New Possibilities

Microsoft's purchase of Minecraft was certainly a surprise. But what does it actually mean for the Minecraft community?

Gamers have little to fear. It makes no sense to make radical changes to this global phenomenon and risk losing its revered position among kids, parents and educators. There might even be new materials, animals, creatures and social interaction options.

As far as modders it's potentially good news too. This purchase could lead to a whole new collection of cool technology, tools and gaming enhancements.

Here's just a few of the Minecraft modding possibilities:

New Languages. While Java is almost certain to remain, Microsoft's .NET technology would enable developers to use multiple languages on the same project. The C# language syntax has a striking similarity to Java, so the learning curve would be minimal. While a Visual Basic or JavaScript option might attract a whole new generation of Minecraft modders.

New Tools. Microsoft Visual Studio development environment is, quite rightly, recognised as a leader in ease-of-use, productivity and multi-language flexibility. Both novice and experience developers would benefit from such an advanced tool. So, maybe Microsoft will release a free community edition of Visual Studio specifically for Minecraft modding activities.

New Platforms. The Raspberry Pi edition of Minecraft, with its built-in Python hacking API, has been a huge success. Microsoft could take this concept and roll it out to PCs and various mobile platforms. This new product could offer enhanced gameplay features, a larger and more powerful API and the choice of development language.

Azure Hosting. Microsoft could release tools which make it a simple operation to build a Minecraft modding server on its Windows Azure cloud network. This would free up modders from having to create their own internet-connected PC setup.

Read more Microsoft analysis posts.