osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to read a directory path from a txt file


On 02/06/2014 15:18, Samuel Kamau wrote:
> I have created a txt file with various paths to directories. The paths look like this
> /home/wachkama/Desktop/api/genshi
> /home/wachkama/Desktop/www/portal/schedule
> /home/wachkama/Desktop/show/help.genshi
>
> How do i read this paths in python ?
>

https://docs.python.org/3/library/functions.html#open
https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com