9-9. py Thon document string. Go to the directory where the python standard library is located. Check each. py file to see if there is any_ Doc _ string. If yes, sort the format properly.ProgramAfter the execution is completed,Beautiful list. lists
When you want a function to receive parameters in the form of tuples or dictionaries, there is a special method that uses*And**Prefix. This method is particularly useful when the function needs to obtain variable numbers of parameters.
>>> Def
7-6 lists and dictionaries. Create a simple stock and securities investment data system. It should contain at least four data items: the stock market display symbol, the stock held, the purchase price and the current price-you can add other data
This script mainly captures resources from the Internet and saves them to local files.
The retriever class in the script is responsible for downloading pages from the web, parsing links in each document, and adding them as necessary.
"To-do"
Python is a simple and cute language. It has been around for a while, but only uses her as a supporting role. She is used only when the evaluation tool is required for simple evaluation, and classes are rarely used, with few more than 100 rows
The configparser module reads and writes configuration files (such as. INI) in Python.
By Saya, (Ayi has slightly changed this article)
Http://hi.baidu.com/saya_sj/blog/item/b68ea92ea82ced594fc22619.html
For example, the userinfo. ini file
Sharkke 13:26:05
File1 content: 11 file2 content: 11
22 33
33 55
44 66
#/! /Usr/bin/Python
Opfile1 = open (file1, 'R ')
Opfile2 = open (file2, 'R ')
For I in opfile1.readlines ():
For m in opfile2.readlines ():
If I = m
Print I
Else:
Pass
Sharkke 1
Database operations have become very useful in Python. With an API standard, the following describes how to use this framework definition. This framework includes the following parts:
Module Interface
Connection object
Cursor object
DBI
OS module:
OS. path. exists (PATH) --> bool # (PATH) file or directory contains OS. path. abspath (PATH) --> STR # (PATH) returns the absolute path of the file or directory # The following are some examples of OS. path. isfile (PATH) --> boolos.
Original post see: http://blog.csdn.net/d8111/archive/2008/09/21/2956832.aspx
Dynamic Language is always so elegant. It is like a peerless sword. A master is used to have a sword in his mind, while a low-handed hacker is fascinated by the fire.
Prerequisites: Upload the logs to the local machine. Use python to extract important errors such as cause by error to the CSV file for tracking.
#! /Usr/bin/ENV python #-*-coding: UTF-8-*- # @ author jinqinghua@gmail.com # @ version 2010-08-17
[Draft version: I have long wanted to write something about Python, but I am too lazy to do it. Because I really don't know what to write-tutorial? Tips? Or feel it? I don't think it is suitable: There are a lot of tutorials, and e-Text
On the Internet, I saw Mei Jinsong's code about how to operate IE,
Http://blog.csdn.net/meijingsong/archive/2004/09/14/103624.aspx
The code is clear, and the only drawback is that the program will always be stuck in
Pythoncom. pumpmessages ()Google
Python has different data types than C, including mutable and immutable)
All the variables in Python are reference values, that is, the variables point to their values by binding. Here, immutable refers to the immutable value. If you want to
Since many services are written in Python, you need to install the python client here, So record the installation process
1. Because the python client depends on the C client, you must first install the C client.
cd
#004 # use three quotation marks (''' or """) multiple-line string Print ''' line1 line2 line3 ''' # In addition, you can also use single and double quotation marks in any three quotation marks Print ''' "what's up? , "He replied. ''' #
#002 # Do not forget to add quotation marks help ('print ') # Do not add quotation marks for certain types of information, because the compiler cannot understand it as a method (function) help (STR)
Output:
The "print" Statement**************
Use existing cookies to access the website
Import cookielib, urllib2
Ckjar = cookielib. cookillacookiejar (OS. Path. Join ('C: \ Documents and Settings \ Tom \ Application Data \ Mozilla \ Firefox \ profiles \ h5m61j1i. default', 'cookies.txt '
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