Since software development tutorials started, I tend to use the simplest Hello World Program as the starting point. I can't help but fall behind this Convention. Let's start with the hello World Program. Starting from this short program, we started our journey of exploring python to develop Win32 API applications on the Windows platform. I hope this trip will allow you to learn more, it will also bring more fun, so that we can change the world and make the world better. Yes. After you learn to develop Win32 applications using python, you can control the world as much as possible.
After you have installed Milang (Milang is a software developed by me: combining Python 3.4 and notepad ++), you can start to write Win32 applications. If you're still confused, when you can't find the north, just click here (http://download.csdn.net/detail/caimouse/7628653), then download the Milang installation package, installed in your computer, the only thing to note, it can only be installed under the root directory of each hard disk. Otherwise, python will not be able to access the library function, resulting in abnormal operation. If you prefer the original Python 3.4 version, you can download it from the python official website. You can also run all the examples in this book. By now, the development environment is ready. You may ask, is that simple? Yes, that's simple. You only need to install one software. The size of the software is only dozens of MB, which is significantly different from the size of the installation packages of several G development tools.
By now, you already have assets for developing Python Win32 applications. Next, enter a few lines of code and press F5 (in the Milang environment ), A window pops up to display the hello World string. The code for the Hello world application is as follows:
From ctypes import *
MessageBox = Windll. user32.messageboxw
MessageBox (none, 'Hello world! ', 'Hello world', 0)
Shows the running result:
Figure 2-1: Result of running the hello World Program