Python - BeautifulSoup 基本應用 (2)
Navigating the tree - Going down
child Tag
前一篇呼叫 Tag 底下的 subTag 是用像 class 的方式 (Tag.subTag),沒完整說明的是這個 subTag 可呼叫到的範圍並不只侷限 children Tag,而是整個 Tag 底下第一個遇到的 Tag.name == subTag。
""" html
<b class="bo…Read More
Python - sys, os.path 常見的 module 應用
Common python module - sys
sys parameter
一些常見系統參數
import sys
print(sys.platform) # linux
sys.argv
像 c/c++ 的 argv 一樣,可以吃從 command line 傳入的參數。
# test.py 123 456 789
print (argv) …Read More
Python 遞迴初學最近用 python 刷題
刷到要用 DFS 的題目,想用遞迴去寫才發現 python 沒有指標
看著討論的 python 大神寫的程式碼,發現都是 python 裡的參數都是指標
下面拿一題示範 0947 - Most Stones Removed with Same Row or Column
class Solution:
def removeStones(self, stones: List[L…Read More
0 意見:
張貼留言