network condition), wait patiently.When you see this interface, congratulations, the installation is successful.The installation is ready, try it quickly!Double-click the Python shortcut on the desktop (if you did not tick the Create Shortcut selection box when you installed it), the following interface appears:The next step is to enter the world of Python, stretch, pose, hand on the keyboard, then press p
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
can print (GetAttr (S1, ' Set_score ', ' No method ') # Gets the method name, if you want to execute the method, call it directly # setattr:# modify the value of a property setattr (S1, ' name ', ' Westos ') print (GetAttr (S1, ' name ')) # Add a property and The corresponding value; SetAttr (S1, ' score ', ") Print (GetAttr (S1, ' score ') # Modify Method Def get_score1 (): Return "This is the method content of the modification" setattr (S1, ' Get_score ', get_score1) print (GetAttr (S1, ' Get
() ' SPAM 'Ordinary strings converted to Unicode stringsIf you concatenate a normal string with a Unicode string, Python automatically converts the normal string to a Unicode string before the connection operation.>>> ' Hello ' + u ' + ' world ' +u '! ' U ' Hello world! '3. Operators that apply only to stringsFormatting operatorsPython-style string formatting operators, only for string types, very similar to the C language inside the printf function
Python learning day 2, python Day 2
Memory address query for python Variables
#!/usr/bin/env python# -*- coding:utf-8 -*-name = "zhang"name1 = "frank"id (name)
Process Control and indentation
If condition:
Execute the next statement (content)
Content 2
Else:
Content 3
Python multithreading learning and python Multithreading
I. Usage of threads in Python:
In Python, there are two ways to use threads: functions or classes to wrap thread objects.
1. Functional Method: Call start_new_thread () function in the thread module to generate a new t
:
Slower running speed
Code cannot be encrypted
Threads cannot use multi-CPU, that is, the multi-core advantage cannot be exploited
code file format: xxx.pyPython interpreter:
CPython: The most widely used interpreter
IPython
PyPy: Fast, using JIT to dynamically compile Python
Jython
IronPython
Python developed from 2 to 3 the most important changes: 3 Uni
website and mobile app selling services more and more models, the latter model does not need to give the source to Others. moreover, Now in full swing open source movement and the Internet free and open spirit is consistent, the Internet has countless very good linux-like open source code, We must not overestimate the code that you write really has very big "business value". The more important reason that the code of those big companies don't want to open is that the code is too bad, and once
Many small partners in learning Wen when said, there are a few commonly used frameworks, a lot of small partners are only said to a few of them, only a small part is said right, want to know more, welcome to subscribepublic Number: Python from program ape to programmerOradd 4913.08659, code: Cauchy, code: Cauchy, welcome everyone to join the talk, this is a learning
valuesMy_dict.clear () Empty dictionarySeven. Collection(1) Unordered non-repeating element (key) set; similar to dictionary, but without "value"Created: X=set ()X={key1,key2,...}Add and remove X.add (' body ')X.remove (' body ')Operators for Collections:- | ! =(2) The set principle is the same as the dict, so it is also not possible to put mutable objects, because it is not possible to determine whether two mutable objects are equal, and there is no guarantee that the set will "have no duplic
Python can be used in many ways as a common language:Web Application Development : Server-side programming, with a rich web development framework, such as Django and TurboGears, to quickly complete a Web site development and Web services. Typical such as the domestic watercress, shell nets, such as Google, Dropbox, etc.; System network Operation : operation and maintenance work, there are a lot of repetitive work place, and need to do the management s
, key is a list, error List is not hash7 Traceback (most recent):8File"", Line 1,inch9Typeerror:unhashable Type:'List' #list is non-hashedTen>>>Conversion between a collection and a listSet () List ()1>>> lst=[1,2,3]2>>> s =Set (LST) #将列表转换成集合3>>>s4Set ([1, 2, 3])5>>> Lst2 =list (s) #将集合转换为列表6>>>Lst27[1, 2, 3]8>>> a =[1,2,2,3,3,6,6,8,9, 0,0] #去除列表中的重复项, set () can be used9>>> s =set (a)Ten>>>s OneSet ([0, 1, 2, 3, 6, 8, 9]) A>>> A =List (s) #去除重复后, and then convert to lists ->>>a -[0, 1, 2, 3, 6
...)3.1.4. ListsThe sequence as one of the basic Python formats is fantastic. Here are some simple examples of how to use the list.Defining a sequence that looks a bit complicated is actually not complicated.LST = [0, 1, 2, 3, 4, 5, ' A ', ' B ', [8, 888], ' 9 ', {' 10 ': 10, 10:100}]LST[1] # 11 integersLST[8] # [8, 888] a sequenceLST[9] # ' 9 ' a stringLST[10] # {' 10 ': 10, 10:100} A dictionaryIt seems to be very flexible, it is so capricious.Slice
Basic Learning notes for exception handling and Python learning notes
An exception is an action taken outside the normal control flow due to a program error. The action is divided into two phases. The first stage is an error that causes an exception. When the system detects an error and is aware of the exception condition, the interpreter (or a programmer can ca
Object-oriented python learning [entry], python object-oriented
Preface
Recently, I have been studying Python object-oriented programming. I have never been familiar with other object-oriented programming languages before. Therefore, learning this part is quite exciting. I w
Learning a language is a constant practice, Python is currently used for data analysis of the most popular language, I recently bought a book "Data analysis Using Python" (Wes McKinney), but also to the library to borrow this "Python Data analysis Basic Tutorial--numpy study Guide" (second edition), ready to the
I was reading a senior student, a small white one, want to learn artificial intelligence. I will share what I have learned every day, and hope that those with whom I like to learn and communicate with each other.So let's start with Python. The first time to write a blog, the heart is a little excited. Hee Hee This tutorial is very simple and can be skipped directly if there is a programming basis for the person. I mainly think of nothing to unde
First, the foregoingNumPy(numerical python abbreviation) is an open source Python Scientific Computing Library. Use NumPy , you can use arrays and matrices in a very natural way . Numpy contains many useful mathematical functions, including linear algebra operations, Fourier transforms, and random number generation functions . The Library's predecessor was a library for array operations that began in 1995
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.