This series is my note in the process of learning the Python language, mainly a number of knowledge points, rather than learning tutorials, for a certain programming basis for reference. The prejudice and insufficiency in the text are unavoidable, for reference only, and the criticism is welcome. The main references in this series of notes are official documents:
Python learning, python
In the previous article, the ORM (Object Relational Model) is implemented. This article mainly implements simple MySQL database operations.
To operate the database, you must first establish a database connection. The following defines a function for creating a database connection. A connection is called an engine.
def create_engine(user,pa
for J in Xrange (Len (Numbers)-1,-1,-1): For I In Xrange (j): if Numbers[i] > numbers[i+1]: # Put the number of small numbers to the top numbers[i], numbers[i+1] = numbers[i+1], numbers[i]print (numb ERS) def main (): # main function = [numbers, 9, 6] Bubblesort (numbers) if __name__ = = ' __main__ ': Main ()Output Result:----------python2.7----------[12, 23, 9, 15, 6][12, 9, 23, 15, 6][12, 9, 15, 23, 6][12, 9, 15, 6, 23][9, 12, 15, 6, 23][ 9, 12, 15, 6, 23][9, 12, 6, 15, 23][9, 12, 6, 15, 23][
Machine learning system Design (Building machines learning Systems with Python)-Willi Richert Luis Pedro Coelho General statementThe book is 2014, after reading only found that there is a second version of the update, 2016. Recommended to read the latest version, the ability to read English version of the proposal, Chinese translation in some places more awkward
the code. The code in the book is a gradual progression from less to more. For each of the books (is every OH) routine, to be able to start from beginning to end every word of each of the keywords are understood what the meaning (the book clearly pointed out that do not understand the neglect of). Then close the book and write the code that will enable the same functionality. At the same time, appropriate changes to the code, such as the deletion of a piece, plus a sentence or something, to dee
Make clean (clears the ". O" file) from the last make command and the executable file) 5 make Distclean (similar to do clean, but also delete all configure generated files, including makefile)Note: You can actually make Distclean directly without performing a 4th step4)/usr/local/bin/python2.7-v (view version information) View System Python version/usr/bin/python-v 5) Modify the original
Transformation:jquery Object [0] = + DOM Object$ (Dom object) = = jquery Object1.id$ ("#id")2.class$ (". CN")3. Get all the A tags in the label$ (' a ')4. Get a collection of multiple labels$ ("a,.cn. #in")5. Hierarchy$ ("#in a") all a labels with an ID of n$ ("#in >a") son level6. Index$ ("#i10 A:eq (2)") ID i10 a label with index value 2And there is: first/: Last7. Filter Properties$ (' [Alex] ')$ ("[Alex=value]")Shorthand: $ (": Value")8. Set disabled in the label can be set to non-editable$
running the Python code directly does not.For example, in the Python interactive environment, enter:>>> 100 + 200 + 300600You can see the results directly 600 .However, write a calc.py file that reads as follows:100 + 200 + 300Then execute in command-line mode:C:\work>python calc.pyfound no output at all.This is normal. To output the result, you must print() pri
features, reducing features, and so on.
each time the model is adjusted using the performance on the validation set, the information for the validation set is leaked to the model. It is harmless to repeat several times, but too many repetitions will eventually result in the model being over-fitted on the validation set and the evaluation result untrustworthy.Once the best model parameters, configuration, and finally all the data on the non-test set training, and finally on the test set tes
number, the inverse is obtained.
[' A ', 123, ' shit ']
Tuple
Length, point to immutable ordered array, more secure
B "I" value by position
(' A ', 789,[1, ' end ')
Dict
MAP, high query efficiency, but low storage efficiency
In is presentGet getting elementsPop "key" delete elementc[' key ') to get a value or add value based on key
{' name ': ' Carter ', ' Age ': 27}
Set
A collection in algebra
Add add Elemen
I remember that the last time I wrote python learning notes was three months ago. During this time, I saw and put it down. This time I had to stick to it and eat python.
This article is based on the concise Python tutorial and some of your own understandings. If you have any questions, please note.
I. Installation in
higher version, to avoid affecting your own Python library files, you can use Pyenv to install multiple isolated versions of Python on one operating system. I have been working in this way to install and switch easily.
Install Python under Mac
Because the Mac also comes with a Python interpreter. There a
Python automated O M course learning-Day1, python automation-day1
This article summarizes the first day of the Python automated O M course for old boys.
The general content is as follows:
Python Introduction
First Python progr
Python learning note _ Python object
Python learning note _ Python object standard type other built-in type object and type object Python Null Object None standard type operator object
People do not see the ancient months, this month has been according to the ancients. Life is so beautiful and short!After two months of learning python, Python's syntax has a rudimentary understanding by doing simple grammar questions and looking at Python syntax. But to work or to do other things, so feel very slow to learn. There is a feeling of being in the wa
execution speed of Python code.
Jython: is a Python interpreter running on the Java platform
IronPython: Similar to Jython, is running on the Microsoft. NET Platform
Ii. History of Python• 1989, Guido began writing the Python language compiler• 1991, the first Python
path operation, read/write stream operation, database operation, network communication and multithreading. familiar with the corresponding operation method and method overloading.Through the above steps of learning to strengthen, in the short term to understand a new language is no problem. Of course, development is not only to understand, more important is to write out, this need to do their own, who can not help you, must write their own, a lot of
Recently began to learn Python language, learned "with children to learn programming", read the official tutorial. Now is looking at the Chinese version of the "Learn Python", I feel this book is really too much, more like a reference book, learning interest is also reduced, I would like to get some web crawl, crawl data, and so on, but feel that the foundation i
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.