摘要:
列表排序 import random # 簡單選擇排序-每次從剩下元素中選擇最小的; nums = [i ** 2 for i in range(2, 15)] random.shuffle(nums) print('打亂列表:', nums) print('- ' * 20) for i in r
閱讀全文
posted @ 2022-07-13 18:06
何方明月
閱讀(806)
推薦(0)
摘要:
import random import time start_running = time.time() # 列表相關操作: # 創建列表的方式: # 1.字面量語法 list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9] print(list1) # 2.構造器語法 list2
閱讀全文
posted @ 2022-07-13 18:06
何方明月
閱讀(167)
推薦(0)
摘要:
a=0 賦值 a>1 a<1 a<=1 a>=1 a!=1 a > 1 and a<5 a<1 or a>5 a='asdasd' 'as' in a
閱讀全文
posted @ 2018-07-22 10:29
何方明月
閱讀(88)
推薦(0)
摘要:
# 使用自換接口的UDP服務器和客戶端 # UDP client and server on localhost # 本地主機上的UDP客戶端和服務器 import sys import argparse #命令行選項與參數解析 import socket #套接字 from datetime import date...
閱讀全文
posted @ 2018-07-20 18:03
何方明月
閱讀(308)
推薦(0)
摘要:
import os def look_name(): os.chdir(path) print('路徑:',os.getcwd()) for i in os.listdir(os.getcwd()): print(i) def all_name(): for i in os.listdir(os.getcwd()): end=i.r...
閱讀全文
posted @ 2018-07-18 17:24
何方明月
閱讀(247)
推薦(0)
摘要:
import requestsfrom bs4 import BeautifulSoupdict_s = {'Upgrade-Insecure-Requests':' 1','Referer':'https://www.696cf.com/htm/downlist6/', 'User - Agent
閱讀全文
posted @ 2018-07-16 11:03
何方明月
閱讀(545)
推薦(0)
摘要:
import requests from bs4 import BeautifulSoup '''Beautiful Soup 學習說明歷程 說明在下''' # 拿到 = requests.get('https://www.autohome.com.cn/all/') # # 拿到.encoding='gbk' # # soup = BeautifulSoup(拿到.text,'html...
閱讀全文
posted @ 2018-07-16 11:02
何方明月
閱讀(196)
推薦(0)
摘要:
Python有大量的模塊,從而使得開發Python程序非常簡潔。類庫有包括三中: Python內部提供的模塊 業內開源的模塊 程序員自己開發的模塊 執行Python代碼時,如果導入了其他的 .py 文件,那么,執行過程中會自動生成一個與其同名的 .pyc 文件,該文件就是Python解釋器編譯之后產
閱讀全文
posted @ 2018-05-25 15:15
何方明月
閱讀(159)
推薦(0)
摘要:
python簡述: Python 是一種面向對象的解釋型計算機編程語言,由荷蘭人guido van iossum (龜叔)于1989年發明,第一個公開發行版發行于1991年。Python是純粹的自由軟件,源代碼和解釋器CPython遵循GPL(GUN General Public License)協議。Python語法簡潔清晰,特色之一是強制用空白符(white space)作為語句縮進。...
閱讀全文
posted @ 2018-05-24 23:27
何方明月
閱讀(447)
推薦(0)