作者查詢 / stucode

總覽項目: 發文 | 留言 | 暱稱
作者 stucode 在 PTT [ Python ] 看板的留言(推文), 共230則
限定看板:Python
[討論] TypeError: 'type' object is not....
[ Python ]7 留言, 推噓總分: +3
作者: sandy946727 - 發表於 2020/01/19 22:12(5年前)
1Fstucode: 參數是 strs 不是 str。01/19 22:20
[問題] 關於設計程式運作流程的問題
[ Python ]8 留言, 推噓總分: +2
作者: Dong0129 - 發表於 2019/12/06 17:21(6年前)
3Fstucode: 因為你 except 把例外攔下來了,想讓它向外傳播的話12/06 23:13
4Fstucode: 在最外層或你想處理例外的地方 try except 就好12/06 23:13
5Fstucode: 如果想在中間做些 logging 可以先攔下來再 re-raise12/06 23:13
[問題] setDaemon 無效
[ Python ]9 留言, 推噓總分: 0
作者: wahahahaaa - 發表於 2019/11/06 11:08(6年前)
2Fstucode: IPython 會在背景啟動 Python interpreter,不把它關掉11/06 18:39
3Fstucode: 就不會「整個程式結束」11/06 18:40
4Fstucode: 所以 5 秒後 a2 會照常印出來,因為執行緒還在跑。11/06 18:40
5Fstucode: https://i.imgur.com/q1bqCnt.png11/06 18:40
6Fstucode: 如果用一般方式執行,就可以觀察到執行緒被中斷:11/06 18:40
7Fstucode: https://i.imgur.com/sXpNbvl.png11/06 18:41
[問題] python 入門該用筆電還是平板?
[ Python ]34 留言, 推噓總分: +12
作者: smallnono10 - 發表於 2019/09/09 21:38(6年前)
14Fstucode: m 大用的應該是 pydroid。09/11 22:40
15Fstucode: 我個人不推在手機上寫,手機螢幕小、打字也不好打,09/11 22:42
16Fstucode: 之前有陣子在手機上寫到手痠只好買了個 OTG 接頭把09/11 22:42
17Fstucode: 鍵盤插在手機上寫。09/11 22:42
Re: [問題] python閉包的語法(修改後囉)
[ Python ]11 留言, 推噓總分: +1
作者: sating00 - 發表於 2019/07/30 22:29(6年前)
1Fstucode: 推你熱心,不過解釋得不太對。07/30 23:23
2Fstucode: 2. f = outer()07/30 23:23
3Fstucode: 不是讓 outer() 可以用 f 呼叫,而是當場呼叫 outer()07/30 23:23
4Fstucode: 並把它的傳回值(也就是 inner 這個 function)07/30 23:24
5Fstucode: assign 給 f。07/30 23:24
6Fstucode: 3. print(f(b))07/30 23:24
7Fstucode: 呼叫 f(b) 等於呼叫 inner(b),不是呼叫 outer()。07/30 23:24
8Fstucode: 所以下面 4. 5. 8. 的流程完全是錯的。07/30 23:24
[問題]
[ Python ]11 留言, 推噓總分: +1
作者: teddyissad - 發表於 2019/07/22 17:41(6年前)
1Fstucode: dict_counter = {} 是建立空字典不是空集合。07/22 18:07
2Fstucode: dict_counter[food] 是查詢字典中 key 為 food 變數內容07/22 18:08
3Fstucode: 的對應值為何,假設07/22 18:08
4Fstucode: dict_counter = {'spam': 3, 'egg': 1}07/22 18:08
5Fstucode: food = 'spam'07/22 18:08
6Fstucode: 那 dict_counter[food] 就是 307/22 18:08
7Fstucode: 而 dict_counter[food] += 1 是把該對應值 +1,07/22 18:08
8Fstucode: 變成 {'spam': 4, 'egg': 1}07/22 18:09
Re: [問題] thread-safe queue
[ Python ]4 留言, 推噓總分: 0
作者: suhang - 發表於 2019/04/26 12:40(6年前)
1Fstucode: 這樣的話不會 overflow 可是會卡死,因為 Ta 的 notify04/26 15:33
2Fstucode: 已經被 Tb 吃掉了,但 Tb 什麼都沒做又繼續回去等待,且04/26 15:33
3Fstucode: T1 也還在等 notify 來喚醒他。造成佇列中還有東西,可是04/26 15:34
4Fstucode: 所有 threads 都在睡的局面。04/26 15:34
[問題] sys.argv無法取得拖曳的Unicode路徑
[ Python ]7 留言, 推噓總分: +1
作者: shala - 發表於 2019/02/27 17:27(6年前)
1Fstucode: 這是舊版 Python 用的 drop handler 的問題,你的 Python02/28 21:31
2Fstucode: 版本是 3.5.3 或 3.6 以上嗎?是的話把登錄註冊表中02/28 21:31
3Fstucode: Python 檔案用的 drop handler 換成02/28 21:31
4Fstucode: {BEA218D2-6950-497B-9434-61683EC065FE} 就可以了。02/28 21:31
[問題] 如何避免執行遇錯時console視窗閃退?
[ Python ]35 留言, 推噓總分: +14
作者: shala - 發表於 2019/01/26 18:21(6年前)
28Fstucode: 推額外寫一個 launcher。01/27 23:55
29Fstucode: 雖然在 atexit 跟 sys.excepthook 暫停都可以達成目的,01/27 23:55
30Fstucode: 但是它們都有一些無法對應的情況。(詳見文件跟01/27 23:56
31Fstucode: issue1230540)01/27 23:57
[問題] 自動備份程式相關問題請教
[ Python ]9 留言, 推噓總分: 0
作者: yimean - 發表於 2019/01/09 19:36(7年前)
3Fstucode: 1. 因為 7z 格式沒有 -mcu 這個選項,zip 格式才有。01/09 22:12
5Fstucode: https://tinyurl.com/ycecc5j901/09 22:22
8Fstucode: 資訊的話直接 google 搜尋 7z CLI 第一個就是了喔。01/09 22:47