看板 [ Python ]
討論串[問題] File1內容跳一行再加File2內容
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓2(2推 0噓 8→)留言10則,0人參與, 最新作者Conjuror (阿糾)時間10年前 (2015/04/17 14:48), 編輯資訊
0
0
0
內容預覽:
with open("file1", "r") as f1,. open("file2", "r") as f2,. open("file3", "w") as f3:. for (i, j) in map(None, f1.readlines(), f2.readlines):. f3.write
(還有53個字)

推噓3(3推 0噓 1→)留言4則,0人參與, 最新作者bigpigbigpig (To littlepig with love)時間10年前 (2015/04/17 11:10), 10年前編輯資訊
0
0
0
內容預覽:
Python 3 :. fi_1 = open('file1','r'). fi_2 = open('file2','r'). lines_1 = fi_1.readlines(). lines_2 = fi_2.readlines(). fi_1.close(). fi_2.close(). fo
(還有1098個字)

推噓0(0推 0噓 3→)留言3則,0人參與, 最新作者Dong0129 (阿東)時間10年前 (2015/04/17 10:45), 10年前編輯資訊
0
0
0
內容預覽:
請問各位版友,. 我有兩個檔案,. File1: File2:. 1 5. 2 6. 3 7. 4 8. 要合併成:. File3:. 1 5. 2 6. 3 7. 4 8. 目前的code:. rfd1=open("file1","r"). rfd2=open("file2","r"). wfd=
(還有356個字)
首頁
上一頁
1
下一頁
尾頁