原创 python中常用的幾個內置函數,map,reduce,filter,sort,sorted

#python map函數的用法 #map()函數語法 #map(function,iterable,。。。)接收兩個參數,第一個參數是函數,第二個參數是可迭代對象 def square(x): return x**2 r =

原创 python 之opencv模塊學習

import cv2 import numpy as np from matplotlib import pyplot as plt # imread第一個參數爲需要載入的圖片路徑名,參數2加載圖像的類型,默認爲1,1代表原圖返回,0代

原创 給定一個列表a,給定一個數字num,如果列表中兩個數據相加的值等於num,輸出這兩個數的下標

#給定一個列表a,給定一個數子num,如果列表中兩個數據相加的值等於num,輸出這兩個數的下標 a = [1,2,3,4,5,6,7] def sum(a,num): for i in range(len(a)):

原创 使用PyCharm創建Django項目及基本配置

https://www.cnblogs.com/liqu/p/9308966.html

原创 linux安裝yum

https://blog.csdn.net/qq_42712552/article/details/88363272     https://jingyan.baidu.com/article/f0062228516229fbd3f0c8

原创 css選擇器

1.分組選擇器 語法:選擇器1,選擇器2{屬性} (注意選擇器1和選擇器2中間用逗號隔開) 含義:選擇選擇器1的元素和選擇器2的元素,一起設置一樣的樣式 .c1,#c3 <!DOCTYPE html> <html lang="en"> <

原创 python進程

#Process創建子進程 from multiprocessing import Process import time def test(): for i in range(5): print("- -

原创 pycharm最新激活碼(2019.7)

MTW881U3Z5-eyJsaWNlbnNlSWQiOiJNVFc4ODFVM1o1IiwibGljZW5zZWVOYW1lIjoiTnNzIEltIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFp

原创 python 集合

# python集合 a = "sdasdasda" a1 = set(a)#把a變成集合(自動去重) print(a1) b = {"a","b","c"} d = "befghj" d = set(d) print(b&d)#交集

原创 python刪除文件夾下面的所有文件

#刪除文件夾下面的所有文件(只刪除文件,不刪除文件夾) import os import shutil #python刪除文件的方法 os.remove(path)path指的是文件的絕對路徑,如: # os.remove(r"E:\c

原创 python生成器

# 第一種寫法: gen = (i for i in range(10)) print(gen,type(gen)) #next(gen)相當於gen.__next__()方法 print(next(gen)) print(gen.__

原创 python動態添加屬性及方法

import types class Person(object): def __init__(self,newName,newAge): self.name = newName self.age

原创 python中的property方法

class Test(): def __init__(self,num): self.__num = num def get(self): print("get方法%s"%self.__

原创 python中的深拷貝與淺拷貝

#python中的深拷貝與淺拷貝 # import sys # print(sys.path)#查看python尋找模塊的路徑順序 # a = b 就是淺拷貝,直接把b的引用指向a,改變b的內容,a中也會變 #copy中的copy()方

原创 python閉包及裝飾器學習

# python 閉包 def test(number): print("--1--") def test_in(num2): print("__2__") print(number+nu