Python--File及OS操做

Python–File及OS操做 一、File操做 Python使用open函數能夠打開一個文件。html 如使用open函數打開"a.txt",打開權限是隻讀。使用該函數會返回一個對象,經過該對象能夠調用一系列文件操做的方法。python file=open("a.txt","r") data=file.readline() print(data) 整個open函數的參數以下:web open(
相關文章
相關標籤/搜索