Yoriz' link should be very helpful to you, but if you want to really learn about how bitmaps work you can check out the technical spec
. If you just want it to work, you can download any source files that you would normally install and just put them in the place you're running Python to get things to work. It's quick and dirty, and but should solve your problem even though it's not something people normally do.
By the way, your code doesn't do anything other than create a file. You get the write() method from the object, but you don't call it or pass anything to it. I mean, there isn't even anything in your code that you would
Due to the reasons discussed here
we will be moving to python-forum.io
on October 1, 2016.
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.