Hi all,
I am new to Python, i have installed python 2.5.4 and it is my
requirement.
I need to retrieve the path of filename in python.
I have found some API's to get this:
from os.path import realpath
print realpath("NEWS.txt") # here NEWS.txt exists and it shows the
path of the file as C:\Pyt
On Feb 25, 8:57 pm, Steve Holden wrote:
> music24...@gmail.com wrote:
> > Hi all,
>
> > I am new to Python, i have installed python 2.5.4 and it is my
> > requirement.
>
> > I need to retrieve the path of filename in python.
>
> > I have found some API's to get this:
>
> > from os.path import real
On Feb 26, 2:35 am, Emile van Sebille wrote:
> Peter Otten wrote:
> > Maybe it's about access rights?
>
> > $ mkdir alpha
> > $ touch alpha/beta
> > $ python -c"import os; print os.path.exists('alpha/beta')"
> > True
> > $ chmod u-x alpha
> > $ python -c"import os; print os.path.exists('alpha/beta
On Feb 26, 9:03 am, Steve Holden wrote:
> music24...@gmail.com wrote:
> > On Feb 26, 2:35 am, Emile van Sebille wrote:
> >> Peter Otten wrote:
> >>> Maybe it's about access rights?
> >>> $ mkdir alpha
> >>> $ touch alpha/beta
> >>> $ python -c"import os; print os.path.exists('alpha/beta')"
> >>>
Hi Dennis Thanks for your reply and also the detailed explanation.
> Or do you mean you want something that, given a bare name, searches
> your file system to find where a file with that name actually is?
>
Yes, this is what i exactly needed.
I have found something interesting to do this