作者AlibabaLin (clluibl2345)
看板Python
標題[問題] 當一個顏值很高的程序員是怎樣一番體驗?
時間Fri May 5 21:20:08 2017
https://www.zhihu.com/question/37787176
小弟在網路上看到這篇文章
簡體網頁
但正妹不分國籍
看到最上面的那個script
想來試試看
但一直error
Traceback (most recent call last):
File "downloadpic.py", line 23, in <module>
limits = int(answers[0])
ValueError: invalid literal for int() with base 10: '(.*?)'
出現這個error
就算用python3也是這個問題
想請問要如何改code
小弟python初學 功力仍然不夠
爬了一些網頁但都找不到答案
請各位大大指點迷津
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.25.121
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1493990411.A.C0B.html
※ 編輯: AlibabaLin (140.112.25.121), 05/05/2017 21:21:24
→ s860134: 抓到 "(.*?)" 了,應該說抓到了這篇的 code 05/05 21:32
就是answer[0]的type是str, 但int(answer[0])出現問題
※ 編輯: AlibabaLin (140.112.25.121), 05/05/2017 21:44:32
→ s860134: isinstance('a',str) 05/05 22:39
推 ghmsxtwo: 一直被業務吃豆腐,表演都要找你,很麻煩 05/06 02:52
推 HenryLiKing: 所有程序媛都超漂亮ㄟ 05/07 19:36