摘要:
字符串方法:mystr.capitalize() 第一個字符轉換為大寫,其它都轉為小寫(本來的大寫字母也轉為小寫) "ab C d" --> Ab c d a_str = 'hello hello' # 1.統計字符串長度 len(a_str) # 長度 11 # 2.統計某子字符串出現的次數 a_
閱讀全文
posted @ 2023-05-26 17:32
sangern
閱讀(27)
推薦(0)
摘要:
批量注釋/取消注釋:Ctrl+/復制光標所在行:Ctrl+D (復制當前行到下一行)Ctrl + C 復制當前行(無需選中,會自動選中光標所在行整行) Ctrl + Y 刪除行的快捷鍵 在上方插入新行【Ctrl + Alt + Enter】在下方插入新行【Shift + Enter】 上下移動選中代
閱讀全文
posted @ 2023-05-06 22:36
sangern
閱讀(1556)
推薦(1)
摘要:
格式化符% name="Tom" age=int(input("age")) pt2="%s你的年齡是%d"%(name,age) print(pt2) %% 百分號標記 #就是輸出一個% %c 字符及其ASCII碼%s 字符串%d 有符號整數(十進制)%u 無符號整數(十進制)%o 無符號整數(八
閱讀全文
posted @ 2017-11-02 12:29
sangern
閱讀(6564)
推薦(1)
摘要:
ip.src == 1.1.1.1ip.dst == 2.2.2.2ip.addr == 3.3.3.3tcp.port == 80tcp.port <= 80tcp.srcport == 80tcp.dstport == 80tcp.flags.syn == 1 //SYN置位報文 【Wiresh
閱讀全文
posted @ 2025-10-13 15:48
sangern
閱讀(101)
推薦(0)
摘要:
過濾器:tcptcp.flags.ack == 0 篩選出所有未設置 ACK 的數據包 ?ip.src_host==192.168.1.100 and tcp.flags.ack==0 可顯示源 IP 為 192.168.1.100 的未確認數據包 ?三次握手的第一次握手?:客戶端發送 SYN 標志
閱讀全文
posted @ 2025-10-13 15:23
sangern
閱讀(28)
推薦(0)
摘要:
天氣 上海PM2.5 | 上海天氣 | 臺風 | 小猴編程 | 課程表 | 四年級語文(下) | 四年級語文(上) | 學生空間 | 初中資料 | 數學 玄數 | 馬同學 | 對數運算法則 | Easymath | MathsIsFun | Think Zone | GeoGebra
閱讀全文
posted @ 2025-05-22 11:34
sangern
閱讀(15)
推薦(0)
摘要:
第一、硬件配置差異從硬件配置的角度來看,GPU服務器和普通服務器有著本質的不同。普通服務器通常配備中央處理器(CPU)、內存、硬盤等基本組件,用于承載和運行各種應用程序和服務。這些服務器通常使用標準的x86架構,硬件配置具有一定的擴展性,可以根據需求擴展存儲容量、內存和處理能力等。GPU服務器則在此
閱讀全文
posted @ 2025-02-11 10:35
sangern
閱讀(58)
推薦(0)
摘要:
AI 通常使用 GPU(Graphic Processing Unit 圖形處理單元)而不是單純依賴 CPU(Central Processing Unit 中央處理器),主要是由兩者在架構和性能特點上的差異決定的,以下是具體分析: 硬件架構差異 CPU:CPU 的設計側重于復雜指令集計算(CSIC
閱讀全文
posted @ 2025-02-10 10:41
sangern
閱讀(645)
推薦(0)
摘要:
下載B站視頻 cmd下輸入以后命令:pip install you-get (需要FQ)you-get -o './' 'https://www.bilibili.com/video/BV1jE411o7uK/?spm_id_from=333.999.0.0&vd_source=a3dc41ec95
閱讀全文
posted @ 2024-12-12 15:37
sangern
閱讀(74)
推薦(0)
摘要:
安裝NumPy:DOS或者 PowerShell下運行命令:pip install numpy(Successfully installed numpy-1.19.5) Pandas是建立在NumPy之上的數據處理庫,安裝Pandaspip install pandas NumPy和Pandas是數
閱讀全文
posted @ 2024-06-04 16:12
sangern
閱讀(133)
推薦(0)
摘要:
wmic os get caption //獲取系統版本Get-Alias -name ls # 查看某一個別名的定義 Get-Alias # 查看所有別名 ipconfig ( 查看 Windows IP 配置, 等同于 Get-NetIPConfiguration ) ls >ls 批量創建文件
閱讀全文
posted @ 2024-05-31 17:32
sangern
閱讀(28)
推薦(0)
摘要:
1.get-command,查找都有哪些指令,get-cmmand簡寫gcm例如 gcm > aaa.txt 結果輸入到 aaa.txt文件中cat aaa.txt 查看文本文件內容more aaa.txt 2、get-help后面跟命令get-help cat 3、clear-host,簡稱cls
閱讀全文
posted @ 2024-05-31 17:13
sangern
閱讀(1204)
推薦(0)
摘要:
Windows PowerShell 是微軟發布的為系統管理員設計的基于任務的自動化命令行外殼(Shell)和相關腳本環境,它建立在.NET框架上。 引入了許多非常有用的新概念,從而進一步擴展了在 Windows 命令提示符和 Windows Script Host 環境中獲得的知識和創建的腳本。
閱讀全文
posted @ 2024-05-30 23:33
sangern
閱讀(257)
推薦(0)
摘要:
S = "你說什么" while S: print(S, end=' ') S = S[1:] else: print()
閱讀全文
posted @ 2024-05-28 21:21
sangern
閱讀(23)
推薦(0)
摘要:
(ab){1,3} 表示ab一起連續出現最少1次,多3次ab{1,3} 表示a,后面出現1~3次 []表示匹配的字符在中,并且只能出現-次 小括號:(ab) -> 分組中括號:[abc], [a-z] -> 匹配abc, a-z中的任意一個字符大括號:{m, n} -> 匹配出現的次數 中括號(方括
閱讀全文
posted @ 2024-02-01 23:38
sangern
閱讀(36)
推薦(0)
摘要:
1、登錄個人github賬號 訪問jupyterlite在github的網站,https://github.com/jupyterlite/demo,并將該倉庫克隆到個人賬戶下; Use this template --> ... 2、轉到個人github界面下,點擊圖中設置部分 3、然后選擇Pag
閱讀全文
posted @ 2024-01-26 10:22
sangern
閱讀(232)
推薦(0)
摘要:
def tuplify_dicts(dicts: list): # 字典列表 轉為 具名元組列表 keys = {key for line in dicts for key in line.keys()} Struct = namedtuple('Struct', sorted(keys), ren
閱讀全文
posted @ 2024-01-24 13:28
sangern
閱讀(20)
推薦(0)
摘要:
def func(a, b=9, c=33): print(a, b, c) func(98) # 98 9 33 func.__defaults__ # (9, 33) func.__defaults__ = 125, 620 func.__defaults__ # (125, 620) 修改了
閱讀全文
posted @ 2024-01-24 13:27
sangern
閱讀(12)
推薦(0)
摘要:
文件--》另存為 》選擇PDF文件 》更多選項 》選項 》包括非打印信息 》選中“創建書簽時使用”
閱讀全文
posted @ 2024-01-17 15:21
sangern
閱讀(283)
推薦(0)
摘要:
用點數(rank_value )和花色(suits_values)兩個因素對每張牌排序,每張牌都有不同的數值 return rank_value * len(suits_values) + suits_values[card.suit] 其中: ranks = [str(n) for n in ra
閱讀全文
posted @ 2023-12-30 11:45
sangern
閱讀(54)
推薦(0)
摘要:
撲克牌點數、花色撲克牌是一種常見的紙牌游戲,它有52張牌,每張牌上都有一個點數和一個花色。 點數:其中點數分為2、3、4、5、6、7、8、9、10、J、Q、K、A,共13種。 J、Q、K:J代表騎士(Jack)、Q代表皇后(Queen)、K代表國王(King)。它們的點數依次為11、12、13. A
閱讀全文
posted @ 2023-12-29 23:38
sangern
閱讀(3603)
推薦(0)
摘要:
Windows中 cmd下:(退出飛機)pip install beautifulsoup4pip install requests Requests庫文檔: https://requests.readthedocs.io/projects/cn/zh-cn/latest/ 安裝完包目錄:Pytho
閱讀全文
posted @ 2023-12-21 23:08
sangern
閱讀(33)
推薦(0)
摘要:
class ClassName: __privt = 50 # 私有變量 a = ClassName() # 私有變量外界無法訪問 print(a.__privt) # AttributeError: 'ClassName' object has no attribute '__privt' pri
閱讀全文
posted @ 2023-12-13 23:13
sangern
閱讀(19)
推薦(0)
摘要:
def next(iterator, default=None): # real signature unknown; restored from __doc__ """ next(iterator[, default]) Return the next item from the iterator
閱讀全文
posted @ 2023-12-11 19:45
sangern
閱讀(14)
推薦(0)
摘要:
\r:表示回車,回到當前行的行首,而不會換到下一行,如果接著輸出的話,本行以前的內容會被逐一覆蓋(光標在該行的頭部)\n:表示換行\r\n:表示換行,換到當前位置的下一行(光標在下一行的頭部)
閱讀全文
posted @ 2023-11-25 23:26
sangern
閱讀(142)
推薦(0)
摘要:
import time a = time.gmtime() b = time.gmtime() print(a == b) # 輸出True print(a is b) # 輸出False print(id(a)) # 2680257978480 print(id(b)) # 26802597848
閱讀全文
posted @ 2023-11-08 15:19
sangern
閱讀(24)
推薦(0)
摘要:
def isleap(year): """Return True for leap years, False for non-leap years.""" return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) import cal
閱讀全文
posted @ 2023-11-07 23:55
sangern
閱讀(58)
推薦(0)
摘要:
在c++中,變量的聲明和賦值可以分開int a;a = 4; 但python中不可以,變量不能只聲明而不賦值,必須在聲明變量的同時,進行賦值
閱讀全文
posted @ 2023-11-06 23:36
sangern
閱讀(51)
推薦(0)
摘要:
for m in range(2,10): for n in range(1,m): print(f"{n}\t{m}\t{m*m-n*n}\t{2*m*n}\t{m*m+n*n}") print()
閱讀全文
posted @ 2023-10-26 23:33
sangern
閱讀(18)
推薦(0)
posted @ 2023-07-05 15:54
sangern
閱讀(25)
推薦(0)
摘要:
小數點在計算機中通常有兩種表示方法,一種是約定所有數值數據的小數點隱含在某一個固定位置上,稱為定點表示法,簡稱定點數;另一種是小數點位置可以浮動,稱為浮點表示法,簡稱浮點數 定點數: 定點數并不是僅僅只能表示整數,定點數也可以表示小數。 浮點數同樣可以表示小數和整數;定點數和浮點數只是計算機表示數據
閱讀全文
posted @ 2023-06-29 21:36
sangern
閱讀(1489)
推薦(0)
摘要:
Manim是3Blue1Brown大佬為了制作數學動畫而自己寫的一個基于python的庫 作者:pdcxs https://www.bilibili.com/read/cv3387999 出處:bilibili 數學可視化領域的佼佼者。通過Manim,你可以用編程的方式生成精確的數學視頻。 Mani
閱讀全文
posted @ 2023-06-29 15:37
sangern
閱讀(235)
推薦(0)
摘要:
模塊:是一個以.py 結尾的Python文件。是常量、變量、函數和類的集合 包(模塊的集合):模塊文件所在的目錄,并且在該目錄下有一個名為_init_.py的文件(Python3.3之前必須,之后不是必須)含有 __init__.py 文件的目錄,目錄下的文件被視為一個單一的包.├── creatu
閱讀全文
posted @ 2023-06-26 11:22
sangern
閱讀(32)
推薦(0)