1. Create an AppIn your project directory, enter:Python manage.py Startapp MyApp (the app name you want to build)Create an app called MyAppIn this way, a directory called MyApp will appear in your project directory.2. Create modelEnter models.py in
Advantages of 1.pythonHigh-level language: No need to consider the details of the underlying implementationPortability: Python programs can run on all platform systems without any modificationExtensibility: You can embed code implemented in C and C +
It comes with Python2.7 and 3.5 on Ubuntu when you enter Python in the terminal to show Python2.7Call everyone how do you switch to Python3.5 version1 to see if python3.5 existsTerminal input Cd/usr/local/libLS View If there is Python3.5 continue
Today's learning Record:F = open ("Song2", "W", encoding= "UTF-8") #文件句柄, open the file in write mode, if not, create a new file F.write ("I love Beijing Tian ' an Men,") # Write statement f.write ("\ nthe sun rises on Tiananmen Square.")
Researched the solution of the Python development GUI desktop application, the research result records as follows:Easygui: Control is very simple, even a basic grid, list components are not, not suitable for commercial, even ordinary applications
A gadget developed by the recent project team wants to add an open method to the right-click menu, taking a cloud note as an example of requirements disassembly and coding1. Demand dismantling:How to manually add the right-click menu to open the way:
Char 14 iterators and parsersIterative: An object that supports ITERIterator: An object returned by ITER that supports next (I)These functions are automatically called by the Python iteration tool, and we can also manually apply the iteration
In Python, the concept of variables is basically the same as the equation variables of the middle school algebra.For example, for an equation y=x*x , it x is a variable. When, the result of the x=2 calculation is 4 , when x=5 , the computed result
1. DocumentsOpen (file, mode= ' R ', Buffering=-1, Encoding=none, Errors=none, Newline=none, Closefd=true, Opener=none)File: The path to the files where the double slash means escape or you can replace the two slashes with backslashes.Mode: Open
First, the basic formSorted (iterable[, cmp[, key[, reverse]]) Iterable.sort (cmp[, key[, reverse])Parameter explanation:(1) iterable specifies the list or iterable to sort, not to mention;(2) CMP is a function that specifies a function to compare
One: Introduction1. Why use built-in objectsObject type is a part of a languageBuilt-in objects make up the core of each Python program2. Core Data typesDigitalStringListDictionaryMeta-groupFileCollectionOther typesProgramming Unit
A. List 1. Define a listname=["Tom", "Jerry", "a", "a", "Lose", "Me"2. IndexAs with the index of a string, the list index starts at 0.Print ("First element:%s"%name[0]) >> first element: TomPrint ("Last element:%s"%name[-1])>> last element: Me3.
There are many ways to do this, and here are three ways to write:
Writing one:
#!/bin/bashwhile Read Linedoecho $linedone
Two:
#!/bin/bashcat filename (file to read) | While read Linedoecho $linedone
Three:
For line in ' cat filename (file to be
Recently took over more and more things, release and operation of the work is quite mechanical, coupled with the frequency is quite high, resulting in time wasted or a lot of advantages. Fix bugs What, test, submit repository (2 minutes), SSH to
1. character encoding#ASCII码里只能存英文和特殊字符 cannot be saved in English 1 bytes 8 bits#中文编码为GBK operating system encoding is also GBK#为了统一存储中文和英文和其他语言文字出现了万国码Unicode all one character takes 2 bytes 16 bits#英文文档改为Unicode编码大小变大一倍 to solve this wasted space
1. Install Windows install dual version Python2,python3Download Python2 and Python3https://www.python.org/downloads/Install two versions separatelyAfter entering the Python3 installation directory, rename Python.exe to Python3.exe and delete the Pip.
Python3 practice-obtain data from a website and python3
As a newbie, you can view and practice some simple practical applications. The following program obtains the required data from a website.
The program may not write well, but it basically
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