I recently became aware of a Tic-Tac-Toe challenge on github where the programmer is supposed to create a Tic-Tac-Toe game that let's the player win every time. You have to code it in Python, although the people behind this challenge prefer you do it with Django. I don't know Django very well, so I decided […]
I recently tried to help someone (on the wxPython mailing list) figure out how to use a Grid widget (wx.grid.Grid) via XRC. It should be simple, but if you run the code below, you'll discover a weird issue: import wx from wx import xrc ######################################################################## class MyApp(wx.App): def OnInit(self): self.res = xrc.XmlResource("grid.xrc") frame = self.res.LoadFrame(None, […]
In this article we will be taking the code from the previous article on Bottle and changing it such that it uses SQLAlchemy instead of just normal SQLite code. This will require you to download the bottle-sqlalchemy package from PyPI. You can also install it using "pip install bottle-sqlalchemy", assuming you have pip installed. You […]
Python has lots of web frameworks. Bottle is one of them and is considered a WSGI Framework. It's also sometimes called a "micro-framework", probably because Bottle consists of just one Python file and has no dependencies besides Python itself. I've been trying to learn it and I was using the official Todo-list tutorial on their […]
Have you ever wondered how to embed custom fonts in Reportlab? Or maybe you just want to switch fonts or change the font's color. Well in this tutorial, we'll take a look at all of these questions. You'll need to go out and download a copy of Reportlab as it isn't a part of the […]
Today I decided to figure out how to make Python log to a file and the console simultaneously. Most of the time, I just want to log to a file, but occasionally I want to be able to see stuff on the console too to help with debugging. I found this ancient example in the […]