Learn and answer questions about Python Program Development

Source: Internet
Author: User

I 've been learning Python program development for a long time. So I 'd like to share with you that you will surely have a lot of gains after reading this article. I hope this article will teach you more. When learning about Python program development, you may encounter Python program development problems. Here we will share with you.

Due to my personal preference and familiarity with ubuntu, the following development process uses ubuntu regardless of the host environment or moblin platform. However, moblin 2.0 does not seem to use ubuntu any more, but only supports fedora, somehow. Start MIC, select memlow-lpia-ubuntu-hard for Platform, and set target to ububtu-mobile for automatic generation. The waiting time is long.

This is also a good tool or a poor tool. I have tried my best to compile almost all modules of the Gnome Mobile framework through commands, but it is not idle. Instead, it is automatically generated by the tool, I am not very concerned with compilation details.

We are looking forward to finishing the compilation and testing. Next, generate the Image file and select Live rw usb. At this point, I thought it was a success. I click Launch VM, and there is no response... depressed. Google, to run KVM, the CPU must support Intel VT, and there is no MID at hand, so try Qemu.

The compiled image file (the file selected during Launch VM) is directly thrown to Qemu. The result is "checking device/dev/sda for installation source...". What is the problem. Attaching the image file to the local device does not show any reason. In fact, Qemu cannot directly run out of the screen as expected (Qemu-hda moblin. img may be used here ).

Because the kernel and file system are generated by MIC, a lot of processing details are unknown, but the compiled files always exist, I want to create all the files required for Qemu Simulation Based on the files generated by MIC. During linux Startup, the system prompts you to enter the user name and password... mount the root file system 1G. img again and delete the shadow? Use a more civilized method to copy the local/etc/shadow to $ {Mount Dir}/etc.

Start again, get the shell, but there is still no graphical interface (if you need to manually start X on the MID, it feels a bit redundant, the problem may be in the configuration, do not go deep, run X again ). There is no/etc/init. d/TPD, or startx. The frustrating thing happened again, "(EE): no valid modes found ". No way. You can only mount the root file system again.

Add Modes "800x133" (only the mode I added, I wonder if it supports others ). After seeing the screen, it may be because of the cost. I think the Moblin interface is still very beautiful. Using the same method, you can use Qemu to simulate other platforms (without one-by-one verification, tested netbook-lpia-moblin2 ).

The Python interpreter converts the source code into bytecode and then translates it into a machine language for running. You don't need to worry about how to compile the program, how to connect to the correct library, etc. You just need to copy the Python program to the target machine and it will work;

Secondly, I have been writing Python recently and feel that it can quickly turn my idea into reality, so I am too lazy to use C. Finally, Python is an extremely popular explanatory language, we can see that the Python programming interface is retained in the Gnome Mobile prototype.

 
 
  1. class Category(models.Model):     
  2.     id = models.AutoField('id', primary_key=True)     
  3.     name = models.CharField(maxlength=50)     
  4.     code = models.CharField(maxlength=50)     
  5.     parentCategory = models.ForeignKey('self', 'id', null=True)     
  6.     enable = models.BooleanField()     
  7.          
  8.     def __str__(self):     
  9.         return self.name     
  10.          
  11.     class Admin:     
  12.         list_display = ('id', 'name', 'code', 'parentCategory')   

Python provides system calling, threads, GTK, and other modules. It can be used to build a prototype to verify the feasibility of the idea. Of course, it can also be easily applied to the development of the Moblin platform. Before developing an application, the configuration environment is indispensable. There is no doubt that the Moblin Image Creator is used, and the required tools and libraries must be installed.

Including Python, the core module (python-starter python-gtk2 python-hildon), since the platform selected previously is ubuntu, you only need to use apt-get to easily install these packages. At this time, the Python Development Environment on moblin is basically built. Next, create an icon on the desktop and start the corresponding Python program. There is no doubt that it is Hello World.

  1. Python source code compilation skills
  2. Simple and Easy-to-use Python tools
  3. Introduction to the Python application field
  4. Python Android Object-Oriented Programming-Python applications
  5. How to Use the Python module to parse the configuration file?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.