Python calculates the time difference, time addition and subtraction code

... how to easily calculate the difference between two times, such as two days difference, a few hours, etc. Using the datetime module can easily solve this problem, for example: import datetime d1 = datetime . datetime ( 2009 , 3 , 23 ) d2 = datetime . datetime ( 2009 , 10 , 7 ) dayCount =...


Print the linked list from end to end - [one day an algorithm question]

... Enter a linked list and return an ArrayList in order from end to end according to the list value. 思想: Stack of ideas # -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None Class Solution: # Returns a sequence of list values ​​from the tail to...


17 Python Sass Skills.md

... title: 17 Python Sassy Tips Date: 2018-09-21 20:21:41 Tags: Programming Python's 17 important "Sao skills" Exchange variable Combine the list into a string Find the highest frequency in the list Check that the two strings are not in the same alphabet in different order. 倒倒 @转 @ Function...


Leetcode2 Adding two numbers

... 题2 Adding two numbers gives two 非空 linked list to represent two non-negative integers. The number of bits is stored in the reverse mode, and each node stores only a single number. Add the two numbers back to a new linked list. You can assume that except for the number 0, neither of...


Array of python sequences

... # container sequence # list,tuple,collection.deque # Storing references to any of the objects they contain #扁序 # str,bytes,bytearray,memoryview and array.array # 存值值, flat sequence is actually a contiguous memory space # Variable sequence # list, #不变序 # tuple,str and bytes Text = [i for...


UDK2017 download and compile

... Download UDK2017 and then download NASM and ASL compiler tools (this seems to be useless), and configure the relevant environment variables. 编译UDK2017 Compile is more troublesome, first cd to the corresponding location of the UDK02017 file, and then run edksetup.bat will be like this....


Install pip and other extensions without sudo privileges. The version is for python2.7 and above.

... 1. Install pip Wget https://bootstrap.pypa.io/get-pip.py Python get-pip.py --user 2. Set environment variables In the current environment, enter export PATH=~/.local/bin:$PATH (I use both sentences when I operate, I don't know which sentence is effective, I suggest the second one)...


SyntaxError in Python: Non-UTF-8 code error solution

... In the program of the seven-section digital tube, I encountered the following error: Non-UTF-8 code starting with '\xc4' In file main.py on line 47, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details First of all, I went to search for the meaning of {'\xc4'}....


Dicom file preprocessing

... dicom file processing some way import required module import os import SimpleITK import dicom import numpy as np import cv2 import glob from tqdm import tqdm first need to import the dicom file we need to process, dicom file is a set of consecutive pictures, we according to the picture...


Create a new Scrapy project and load it into pycharm to record

... 1. First find the scrappy executable file. My scrapy.exe is in the F:\python\Scripts directory and add the F:\python\Scripts directory to the environment variable. In the middle, add the environment variable after the English semicolon to add OK 2. After adding the environment variable,...