This is an article published inKivyspacegameThe article on how to use python to access the sensor on your Android device. This tutorial is written for the development of Python mobile apps with Kivy . The Kivy runs very fast and is easy to use. Visit the blog for more tutorials on developing games with
Python Development Android and iOS app library Kivy installation attempt:Let's take a look at what the goods can be used to make:
Create a package for Windows
Create a package for Android
Creating Packages for OS X
Create a package for IOS
The rhythm of the day, Ah, although the 600+ page of the English document, python3+ still on the "the", I think the potential of the goods.Of co
Use Kivy to package the python program as an apk file,
1. Overview
KivyYesPythonThe cross-platform open-source application development framework is available on the official website.ItPythonProgram Package as AndroidapkInstallation File. The following is used in windows.
Many things will be downloaded during installation and configuration to ensure stable access.InternetIn addition, we recommend a video tut
Python pip and kivy installation tutorial, pipkivy
Install pip. We also need to download it on the Python official website.
: Https://pypi.python.org/pypi/pip
After the download is complete, decompress the package to a folder, use the CMD console to enter the decompressed directory, and enter:
Python setup. py inst
We install PIP. We also need to download it on Python's official website.: Https://pypi.python.org/pypi/pipAfter the download is complete, unzip to a folder, use the CMD console to enter the Extract directory, enter:Python setup.py InstallOnce installed, we enter PIP directly at the command line, which also shows that ' Pip ' is not an internal command or a running program. Because we haven't added environment variables yet.Then install KivySame installation address and official tutorial address
Online translatorhttps://www.bing.com/translator/Cython 0.27 was released. To be exact, Cython is a separate language, designed to be used to write an extension library for import in Python. In fact, Cython's syntax is basically consistent with Python, and Cython has a dedicated "compiler" that turns Cython code into C (automatically joins a whole bunch of c-python
URLRequest
The content is also decoded (decoding) if the ContentType is Application/json and the result automatically (automatically) passed T Hrough json.loads.
Examples of official documents:defGot_weather (req, results): forKey, Valueinchresults['Weather'][0].items ():Print(Key,': ', value)Req=URLRequest ('HTTP://API.OPENWEATHERMAP.ORG/DATA/2.5/WEATHER?Q=PARIS,FR', got_weather)Where Got_weather is the on_success handler function (Hook?) for which the request succeeds, and
/canvas_stress.pyThis is a sample of a randomly drawn rectangle12, canvas/circle.pyThis is an example of a graphic that can be distorted and displayed in a fan-shaped image.In the sample folder there are a lot of examples, not one by one cases. Look at the demo sample. Kivy's graphics library is still relatively powerful and can meet major development needs.From the next chapter, we start with the basic control of Kivy's graphic library, KV language, Canvas,property concept Copyright notice: Thi
'): continue p = join(root,f) size = os.path.getsize(p) fstat = os.stat(p) info = (size,fstat.st_mtime) if p in file_info and info == file_info[p]: if os.path.exists(p.replace('.py','.pyo')): continue print 'compile ',p print subprocess.check_output('python -OO -m py_compile '+p)def sync_source(): for root, dirs, files in o
Because the handle has been relatively defective, so intends to use a mobile phone to control the car, but the problem comes again, I will not Java, how to write the app?After a search on the internet, I found Python can also write mobile app, simply high-end, but to install the Kivy framework. After a search on the internet, it was found that the information was two years old, but it does not prevent me fr
This is the first draft, should be further modified, after all, illustrations better edible, suggestions and comments despite comments, progress together! On a 51cto above, it should be in the future, the 51cto blog editing system is really torture goblin0x01 System ConfigurationSystem and Python parametersLinux gnu-virtualbox 3.16.0-23-generic #31-ubuntu SMP Tue Oct 18:00:35 UTC i686 i686 i686 gnu/linuxPython 2.7.8Lubuntu 14.100x02 installation KivyI
NonsenseThe goal is to do mobile development, this focus on Android development.
To confirm that I was able to compile correctly as APK, I first tried the full package apk on the Mac.
There is no internet talk so troublesome, also do not have to download his Ubuntu image, that is a bit more than the pit, but also to download more things. For a whole day, half of the time is spent waiting for downloads.
There is no edge to write, and all of the places on the whole to say, if there are readers
automatically downloaded.) #android. Sdk_path =# (str) Android entry POint, default is OK for kivy-based app#android.entrypoint = org.renpy.android.pythonactivity# (list) List of Java. jar file s to add to the Libs so that Pyjnius can access# their classes. Don ' t add jars that don't need, since extra jars can slow# down the build process. Allows wildcards matching, for example:# ouya-odk/libs/*.jar#android.add_jars = foo.jar,bar.jar,path/to/more/*.
Kivy-Open Source Python library for rapid developmentApplications that use innovative user interfaces, such as multi-touch applications1 python pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew2 python pip ins Tall Kivy.deps.gstreamer-Kivy-kivy_examplesTe
This tutorial will lead you to learn to create your own widgets (widgets). In the end, the work we finished is a simple artboard program.When creating an app with Kivy, we need to consider the following 3 questions:
What data does the app we create need to process?
How do I visualize this data?
How do users interact with this data?
Taking the simple artboard of this tutorial as an example, we want users to be able to draw on the
Kivy is intended for touch-screen devices. The processing of input devices, such as keyboards and remote controls, is relatively weak. However, sometimes we need to process keys, such as switching the focus through the direction keys, this article discusses how to implement it.
Before reading the following code, it is best to have a basic understanding of the kivy UI system.
By convention, we first go to
Refer to Kivy Document page 796, Kivy Most controls use the absolute coordinate system by default, the window coordinate system, where the origin is in the lower-left corner of the screen window, and the coordinates of all controls are the absolute coordinates relative to the lower-left corner of the screen.Relativelayout uses a relative coordinate system, the relative coordinate system, if relativelayout e
Recently in learning Kivy, practice writing demo when found Chinese can not be displayed correctly, online query said to specify the font can be found in the OS X font Library directory
/system/library/fonts, you can directly use the Chinese font such as, bold: ' Stheiti MEDIUM.TTC ', in the code used as follows:
Self.add_widget (Label (text= ' username: ', font_name= ' Stheiti MEDIUM.TTC '))
If you do not want to use the font of the system, but
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.