YUNOVA · Python programming · Module 9: Errors & Files
Python se file read karna - open() aur with
Python se file read karna - open() aur with
Key points
- open() से file खुलती है और read() से उसका content मिलता है।
- with लिखकर खोलने पर file अपने आप बंद हो जाती है।
- File न मिलने पर error आता है, जिसे try से संभाला जा सकता है।