Python string common operations
1. String separation
1.1 split() method
Function: the split() method starts from the left side of the string. The default split character is the space character, and the return value is the list.
For example: create a string str_1; Right str_1 and use the split() method
str_1 = 'a str of practice'
print(str_1.split())
The operation results ...
Added by atl_andy on Tue, 22 Feb 2022 14:49:30 +0200
[note] nesting of python: dictionary list, store list in dictionary, store dictionary in dictionary
1, Nesting of python
Sometimes you need to store a series of dictionaries in a list or a list as a value in a dictionary, which is called nesting. We can nest dictionaries in lists, lists in dictionaries, and even dictionaries in dictionaries.
2, Dictionary list
Remember our previous example of aliens, if dictionary alien_0 contains all ...
Added by leony on Tue, 22 Feb 2022 12:55:02 +0200
[basic Python tutorial] data types in Python language
preface
We mentioned the built-in numeric and string types in Python data types earlier. Today, learn about the sequence data type of Python. You should know that there is no data structure of array in Python, nor does it provide the function of directly creating array, but you can use the built-in sequence data type to realize some func ...
Added by zeropaid on Tue, 22 Feb 2022 11:56:32 +0200
Data processing related
Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it
1, Data sorting
1. sort
If the direction is not indicated in sort, it will be sorted in ascending order by defaultIn multidimensional tensors, sorting is not in the global case, but in t ...
Added by livvylove on Tue, 22 Feb 2022 11:08:54 +0200
[introduction to raspberry pie] Experiment 2 Python programming basis
Experimental principle
Python programs can run / execute in two different ways. Method 1:
Open IDLE3 through the desktop icon or start menuIDE loading may take some timeAfter the IDE is loaded, a Python shell window is displayedIn the Python shell window, type the following command print("Hello World")Press enter and you will see Hello Wo ...
Added by Beavis2084 on Tue, 22 Feb 2022 10:49:19 +0200
Magical quantum world -- quantum genetic algorithm (implemented by Python&Matlab)
catalogue
1 important knowledge points
1.1 genetic algorithm
1.2 quantum computing
1.3 quantum genetic algorithm
2. Operation steps
3 flow chart
4 quantum genetic algorithm -- Python implementation
4.1 data
4.2 code
4.3 results
5 quantum genetic algorithm -- Matlab implementation
1 important knowledge points
In ...
Added by jpaloyo on Tue, 22 Feb 2022 09:32:57 +0200
Python crawlers - requests and selenium camouflage headers and agents to deal with anti crawling mechanism
catalogue
1. requests headers Send request2. selenium simulation uses browser camouflage headers3. requests use ip Proxy send request4. selenium webdriver uses proxy ip
In the process of writing crawlers, some websites will set up anti crawling mechanism to refuse to respond to non browser access; Or frequent crawling in a short time will ...
Added by hnxuying on Tue, 22 Feb 2022 07:58:13 +0200
The application of RPC technology and its framework Sekiro in crawler reverse is a shuttle for encrypting data!
What is RPCRPC, English RangPaCong, Chinese let the reptile, designed to open the way for the reptile, kill everything every second, and let the reptile unobstructed!Just kidding, in fact, RPC is a Remote Procedure Call, which is a technical idea rather than a specification or protocol. In fact, the birth of RPC is inseparable from the developm ...
Added by fnbcprog on Tue, 22 Feb 2022 05:06:50 +0200
Python notes 15 - file operations
Python notes
File operation
I Role of file operation
Function: store some contents (data) so that the next execution of the program can be used directly without remaking.
II Basic operation of files
1. Document operation steps
Open fileRead and write operationsClose file
Note: it can refer to opening and closing files wi ...
Added by Janus13 on Tue, 22 Feb 2022 02:08:09 +0200
python Basics (interview)
Differences between get post requests
1. post Request security higher than get. get Request to expose parameters directly to url Up, post Request to hide parameters
To pass a password post
2. get The request has a limit on the length of the data, url The maximum length of is 2048 characters. post unlimited
When transferring large amounts ...
Added by Hodo on Mon, 21 Feb 2022 17:45:57 +0200