int值如果我有一個url
像examle/def/5/
,我試圖找到int
值從url
使用我怎樣才能從URL
re.findall([0-9],'examle/def/5/')
,但我得到一個錯誤。
Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/re.py", line 177, in findall return _compile(pattern, flags).findall(string) File "/usr/lib/python2.7/re.py", line 229, in _compile p = _cache.get(cachekey) TypeError: unhashable type: 'list'
我該怎麼做?
什麼錯誤?請分享一個回溯。 – geoffspear
回溯(最近通話最後一個): 文件 「」,1號線,在 文件 「/usr/lib/python2.7/re.py」,線路177,在的findall 回報_compile(圖案,旗) .findall(字符串) 文件「/usr/lib/python2.7/re.py」,第229行,在_compile中 p = _cache.get(cachekey) TypeError:不可用類型:'list' –
請更新您的問題跟蹤反而放在評論中。 – falsetru