Beginner python, the small edge of a few questions:
There is a list
A = [1, 2, 3, 4, 5, 6]
Please use a according to
0, 1
1, 2
2, 3
3, 4
4, 5
5, 6
Print output,
2. Reverse a list to [6, 5, 4, 3, 2, 1]
3. Select the even number in a and the result is
Recently there was a small Web project that wanted to use the favorite Python, but I felt a shudder at the thought of the previous contact with Django, why? The Django configuration was too complex and the small project was not well suited to the
Just so bored, suddenly remembered to do a timetable before the idea, so Baidu got up.
At first, I was thinking: when writing a wall, using the Urllib2 "two lines of code to catch the page", then only the parsing of HTML. So Baidu: Python parsing
These two days free to do nothing in Baidu Amoy a little picture, not much, also on tens of thousands of, which has a lot of beautiful pictures of Austria! Ha ha! Here for a moment not to say how the picture was obtained, I talk about getting
So I want to turn these pictures over, but the pictures of the phone
is automatically divided by the time folder, a folder copy is very troublesome, so I intend to write a small Python script to complete the work (pull so much, finally
To the
Because a function is also an object, and a function object can be assigned to a variable, the function can also be called through a variable.
>>> def now (): ... print ' 2013-12-25 ' ...>>> f = now>>> f () 2013-12-25
The function object has a _
Python's Functools module provides a number of useful features, one of which is the partial function. It is important to note that the partial function here is not the same as the partial function in mathematical sense.
When we introduce the
1. XLRD (especially read operations) is recommended for simple read and write operations in Excel in Python
2. Go to http://pypi.python.org/pypi/xlrd to download the XLRD library;
3. The project code is as follows:
The code is as follows:
First, the service side (server.py)
The thing to do on the service side is:
1. Create a Socket object
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Import
socketS
=
Socket.socket (socket.af_inet,
It is the Python language's binding to the popular Wxwidgets cross-platform GUI ToolPak. And Wxwidgets is written in the C + + language.
Like the Python language and the wxwidgets GUI tool library, Wxpython is open source software. This means that
For example, the format of our storage:
Format of:Name, age | Another user name, age
Name:haha,age:20|name:python,age:30|name:fef,age:55
Then we can cut the string object into a list by the split method of the string object.
A = '
The copy of ********.bmp or copy of copy of ********.bmp such files are uniformly named ********0.bmp or ********00.bmp format, and the number of the following 0 represents ********. The number of BMP occurrences +1. Wrote a small script below:
The
The code is as follows:
#-*-Coding:utf-8-*-From win32com.client import DispatchImport timedef start_office_application (app_name):# after getting to the app here, the rest of the operation is similar to operating the Office software through VBAApp
This bo can be said even the opening line can be omitted, the reason is DDoS, not because of the mad dog was chased to bite, but because of the VC tragedy after the flow of all to SIMPLECD came.
Not only that, some idiots are grasping the station,
For example: ' String ', ' string ', ' ' ' ', ' ' ' ', ' ' or ' string '.
In use, there is no difference between single and double quotes. The main function of the three quotation marks is to include line breaks in the string. That is, the string in
A good integrated development environment, can greatly improve the efficiency of programming. So, I need to find a good python development tool first.
Eclipse +pydev, it feels good. I put the key points of the installation process in detail in this
1 IDLE1.1 Idle is an integrated development environment created by Python Guido van Rossum using Python and Tkinter. To use idle, you must install Python and Tkinter.1.2 Features: Auto indent, Color coding, command history (alt+p,alt+n) and Word
The function is relatively simple, see the following example:
The code is as follows:
s = ' HEllo PYthon 'Print S.upper ()Print S.lower ()Print S.capitalize ()Print S.title ()
Output Result:
HELLO PYTHON
Hello python
Hello python
Hello Python
To
Recently picked up Django, but Django does not support MongoDB, but there is a module mongoengine that can implement a Django model-like package. But Mongoengine's Chinese documents are almost none, Some of them are short sentences to introduce and
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