作者查詢 / alubasteve

總覽項目: 發文 | 留言 | 暱稱
作者 alubasteve 在 PTT [ Python ] 看板的留言(推文), 共266則
限定看板:Python
首頁
上一頁
1
2
下一頁
尾頁
[問題] 請問解壓縮檔案要如何讀取?
[ Python ]108 留言, 推噓總分: +2
作者: alubasteve - 發表於 2019/03/01 17:00(7年前)
3Falubasteve: 我試過了,很抱歉沒用,如果r前後有""的話03/01 17:42
4Falubasteve: 還是找不到python.zip,可是我已經在Lib裡頭放了03/01 17:44
5Falubasteve: 如果r沒有"",則顯示r沒有被定義03/01 17:44
8Falubasteve: 給djshen,多謝提醒,我怕錯誤訊息太長,反而眼花03/01 19:07
9Falubasteve: 給lajji,多謝你提醒,我改成在檔名前追加絕對路徑03/01 19:08
10Falubasteve: 然後就成了,所以問題是出在我的相對路徑抓不到03/01 19:10
11Falubasteve: files=zipfile.ZipFile("c:\python\python.zip")即可03/01 19:14
19Falubasteve: Traceback (most recent call last):03/01 20:42
20Falubasteve: File "<pyshell#3>", line 1, in <module>03/01 20:48
21Falubasteve: files=zipfile.ZipFile("python.zip")03/01 20:48
22Falubasteve: File "C:\Users\user\AppData\Local\Programs\03/01 20:49
23Falubasteve: \Python\Python37\lib\zipfile.py", line 1182, in __03/01 20:49
24Falubasteve: self.fp = io.open(file, filemode)03/01 20:50
25Falubasteve: FileNotFoundError: [Errno 2] No such file03/01 20:50
26Falubasteve: or directory: 'python.zip'03/01 20:51
27Falubasteve: 抱歉我弄巧成拙,請各位過目我碰到的問題訊息03/01 20:52
29Falubasteve: import zipfile03/01 21:44
30Falubasteve: files=zipfile.ZipFile("python.zip")03/01 21:45
32Falubasteve: 給djshen,抱歉我不知道python command跟command line03/01 22:45
33Falubasteve: 的差異,可以請你告訴我嗎03/01 22:51
51Falubasteve: 給gmccntzx1,我就是這樣做,我改成03/02 00:14
52Falubasteve: import zipfile03/02 00:14
53Falubasteve: zip_file=zipfile.ZipFile("C:\python\python.zip")03/02 00:15
54Falubasteve: 追加絕對路徑在檔名之前之後就不會再出現錯誤訊息03/02 00:22
57Falubasteve: 不會,很感謝你的熱心解說03/02 00:27
58Falubasteve: 順便問一句,我試著全解壓縮python.zip,但是似乎只能03/02 00:32
59Falubasteve: 解壓縮到原有路徑C:\python,請問這樣合理嗎03/02 00:34
62Falubasteve: import zipfile03/02 00:40
63Falubasteve: zip_file=zipfile.ZipFile("C:\python\python.zip")03/02 00:43
64Falubasteve: zip_file.extractall("C:\python")03/02 00:43
65Falubasteve: zip_file.close()03/02 00:43
66Falubasteve: 上面沒問題 ,但是第三行改成03/02 00:46
67Falubasteve: zip_file.extractall("C:\python\2") 就有問題03/02 00:50
68Falubasteve: Traceback (most recent call last):03/02 00:50
69Falubasteve: File "<pyshell#2>", line 1, in <module>03/02 00:50
70Falubasteve: zip_file.extractall("C:\python\2")03/02 00:51
71Falubasteve: File "C:\Users\user\AppData\Local\Programs\03/02 00:51
72Falubasteve: \Python\Python37\lib\zipfile.py", line 1594,03/02 00:52
73Falubasteve: , in extractall03/02 00:52
74Falubasteve: self._extract_member(zipinfo, path, pwd)03/02 00:53
75Falubasteve: File "C:\Users\user\AppData\Local\Programs\03/02 00:53
76Falubasteve: \Python37\lib\zipfile.py", line 1640, in _extract_03/02 00:54
77Falubasteve: member03/02 00:55
78Falubasteve: os.makedirs(upperdirs)03/02 00:55
79Falubasteve: File "C:\Users\user\AppData\Local\Programs\03/02 00:56
80Falubasteve: Python\Python37\lib\os.py", line 221,03/02 00:56
81Falubasteve: in makedirs03/02 00:56
82Falubasteve: mkdir(name, mode)03/02 00:57
83Falubasteve: OSError: [WinError 123] 檔案名稱、目錄名稱03/02 00:57
84Falubasteve: 或磁碟區標籤語法錯誤。: 'C:\\python\x02'03/02 00:57
95Falubasteve: https://pastebin.com/2s74QxGR 請問這樣方便嗎03/02 07:46
96Falubasteve: 不好意思我是第一次聽說pastebin ,所以不大敢用03/02 07:50
97Falubasteve: 剛才試用才知道還不算難03/02 07:51
104Falubasteve: 感謝gmccntzx1開示,我兩種路徑的方法試過都OK了03/02 13:27
105Falubasteve: 也試過直接解壓縮在新路徑資料夾上03/02 13:29
106Falubasteve: 也謝謝前文諸位網友指教,讓我可以快速抓到盲點在哪03/02 13:30
107Falubasteve: 我上午出門所以回覆的比較晚,請gmccntzx1多包涵03/02 13:33
[問題] 完全新手如何學爬蟲、資料整理與分析
[ Python ]44 留言, 推噓總分: +13
作者: alubasteve - 發表於 2018/01/27 13:37(8年前)
10Falubasteve: 給f496328mm,請問您比較推薦哪本書?01/27 14:06
15Falubasteve: 請問以下幾個網站評價如何?https://goo.gl/YLc4pj01/27 16:43
16Falubasteve: https://learnpythonthehardway.org/python3/01/27 16:45
20Falubasteve: 請問諸位版友所提之大數軟體,是指大數學堂01/27 20:04
21Falubasteve: 還是指YOUTUBE的影片01/27 20:05
首頁
上一頁
1
2
下一頁
尾頁