web hosting and development forums
Web Design and Development Forums Archive


Index - Python programming forum

reading line from a file


Post reply

If i have an integer, and say for example that integer is 500, how do i tell python to read line 500 from a file?
kadamat: read the first 500 lines, thowing away the first 499
Using a loop?
kadamat, yes or if your file is not to big, you can also use f.readlines()[499] to get 500th line




Dubai Forum | Paris Forum | Webmaster Forum | Vegan Forum | Brisbane Forum | 3D Forum | Jobs in Dubai | Jobs in London | London UK Classifieds
Archive script by RedHo.com