Why do I learn python?
First, my first language is C/C ++ (Object-Oriented subset ). On the one hand, I chose to learn Python because many people say that python development is highly efficient, so I want to verify it. On the other hand, Eric S.
Yesterday I wrotePythonThe method for operating MySQL is written according to the parameters provided in the document. After writing it, I test it and find that an Encoding Error is reported. I don't know why this error is reported, I usually care
Last time I wrote a tutorial on downloading Python web pages. Today I want to talk to you about another library:Python urllibMany Web pages can be processed using the urllib standard library. Next I will share the urllib content that I usually use:
If we need to copy a list, we can use a special method. Let's talk about it today.
First, define a list.A = [1, 2, 34]Then, I use the built-in method ID () to view the object address.Print ID ()Target address: 11488352
Then I copy a list of A and
We need to use the time module to obtain the date in Python, such as the time. strftime method.
Time. strftime ('% Y-% m-% d', time. localtime (Time. Time ()))
Finally, we used the time. strftime () method to format a large string of information
Python reference:In python, when an internal value variable is assigned, a reference variable is passed, which is similar to that of the C language,For exampleA = [1, 2, 3]The address where variable A saves the listIn python, you can use ID () to
The server I use now is centos release 5.4 (final), but python is still 2.4.3, which is relatively low. I always want to update it. The last time python was forcibly uninstalled, yum and some basic commands could not be used. Therefore, do not
1. yasnippet
2. AutoComplete
3. Rope
PIP install rope
4. pymacs
(1) make install(2) then copy the compiled pymacs. El to the load path.(3) or compile it in bytes:Start Emacs and runM-x byte-compile-file RET pymacs. El RETThis command generates
We all know that win7 uses GBK by default, while Ubuntu uses UTF-8 by default. Sometimes ourCodeIt needs to be edited on two platforms, so it is necessary to set up the eclipse encoding. Of course, this is not only used for pydev, but also for
Make a summary:
Maybe I haven't found a better method yet, but unfortunately, Python does not seem to support similar shell scripts, Perl
The scalar interpolation is supported, so it cannot be displayed like the following. This kind of
Download and install python2.7: preferably Win32, which is not supported by many lib of 64bit. Python-1, 2.7.3
Http://python.org/getit/releases/2.7.3/
Download and install ez_setup.py: setuptools-0.6c11.win32-py2.7
Well, meego's Chinese core site, miqu.com, has published a new blog.I have introduced youPyqueryNext we will introduceBeautifulsoupBeautiful soup is a built-in Python web analysis tool named beautiful butterfly. Oh, sometimes it's as beautiful as a
1. the python Singleton mode is described here in two ways. One is implemented by createmutex of win32event, and the other is to define a global variable.
The first implementation method can refer to here http://code.activestate.com/recipes/474070-
Boost 1.34 finally simplifies support for Embedded python.
Python2.5 is also supported.
During the process of compiling boost with vc8 in Chinese windows
Code Page character warning, but it can be compiled successfully. It does not cause the
I. Python Multithreading
Because the implementation of cpython uses global interpereter lock (Gil), only one thread is executing in python at the same time, which simplifies the implementation of the python interpreter, the Python object model is
I recently used python to do some web page analysis tasks. I haven't updated my blog for a long time. I will make it up today. The followingCodeUsed
1. Python Multithreading
2. webpage analysis Library: beautifulsoup, which is much more powerful
I. Functions
If you need to reuse the code in the program, --------- defines the function. Def function name (parameter): // todo
For example:
Output:
You can also define function parameters as default parameters. Note: The default parameters are
I have said that if I have time, I will sort out the source code of a modifier used to check the parameter type and put it on .. It took a while to complete the process. Because the code in the company was not convenient to come out, this module was
Sometimes, if you want to update or migrate some SQL server data, you can only use the SQL statement to select the entire number of statements. Even the cursor of the advanced point cannot be converted? It's annoying to pick up VS and write a small
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