In python, the date and time function does not seem to add a date (time) variable to the function for a few months. It is written in the same way as in Delphi.CodeAs follows:
Import calendar
Yearmonth = (, 31, 31 ),(, 31, 31 ))
def addmonths
Concise Python tutorial --- 16. What to learn next
So far, the basic knowledge about Python has been introduced. So what should I learn next?
Graphics Software
There are many options for using Python Gui:
Pyqt this is the python binding of
The Python SDK has been installed in the previous section. You can introduce the Weibo module in the program to write Weibo programs. The function of the following program is to use this module to send a new microblog with the specific code first:
#
This section will improve the Weibo program in the previous section. The main improvement function is to save the authorized access_token without repeated authorization. Take a look at the directory structure of this project (1 ).
Figure
1. If the variable name in the function appears before = for the first time, it is regarded as defining a local variable, no matter whether the variable name is used in the global domain, the function uses local variables, for example:
num = 100def
Today, I saw how to draw charts using python. There is a powerful class library matplotlib that can produce high-quality 2D and 3D images. Record them first, and then learn it slowly.
Matplotlib download and API manual address:
In recent years, we have seen such replies in various forums: no picture, no truth. When you frequently write weekly work reports or experiment results, you need to paste several images. Clipboard), paste the image in the clipboard to the canvas,
It seems that you need to sort out the python scripts used:
A simple thing is to convert line breaks in '\ n',' \ r \ n', and '\ R' 3.Usage
usage: eol_convert.py [-h] [-r] [-m {u,p,w,m,d}] [-k] [-f] filename [filename
The following error occurs: runtimeerror: Second simultaneous read on fileno 8 detected. unless you really know what you're re doing, make sure that only one greenthread can read any participant socket. consider using a pools. pool. if you do know
Document directory
1. Definition of Classes
3. Class methods:
5. Data Hiding
1. Class account (object ):
"A simple class"
Account_type = "Basic"
Def _ init _ (self, name, balance ):
"Initializing a new account instance"
Self. Name = Name
Self.
1. First download and install the py2exe module:
For: http://www.py2exe.org/old/
Download the corresponding version number for Installation
2. Create a simple Python program and save it as hello. py. Put it in the python installation directory. Here
Shell> VI 2.py
#! /Usr/bin/ENV Python
STR = ("I am a worker, and you are a student! ")
Print Str
# Split the STR, if not specified the separator, the whitespace is a separator, items is a sequence
Items = Str. Split ()
Print
Filter the following conditions for an item with a value in the list:
(1) Delete the first match that matches a certain value
Use the remove function, such as list. Remove (1). The first item with a value of 1 is deleted.
(2) Delete all matching
Several examples of deep learning are written in Python. As a result, I have a little bit of knowledge about Python, although I have always liked Microsoft. However, Microsoft accounts cannot be sold for scientific research.
IDE is preferred for
Recently, the top league of Bundesliga and the Major League of La Liga have been fighting again. I think of a piece of code that I have previously written to generate a competition schedule. It is so comfortable to use python to write this kind of
The python2.73python function has a function called closure. In fact, there is also a type of operation similar to the closure effect.
>>> Class :... pass...> A = A >>> A >>> B = a () >>> B >> type (a) #a is a Class Object >>> type (B) # B is a
Sixth off address: http://www.pythonchallenge.com/pc/def/channel.html
After entering the page, there are no other things except two images, and you can view the source code of the page.
The Source Code contains the following sentence:
Okay, use zip
How to compile the python list. In fact, there are a lot of problems in use. Let's take a look at the usage. A famous example of how to compile the connotation of a list is to generate a 9-9 multiplication table.
Summary of Python Process Control
In python, how does one obtain the path of the script file?
First, we do not obtain the "current path", that is, OS. getcwd ()
This includes two obfuscation problems: first, obtaining the path of the current script file and second, obtaining the
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