<a href="http://f.name">f.name</a> will return the path.  But if you want to guarantee getting the absolute pathname use os.path.abspath<br><br><div>>>> import os</div><div><div>>>> os.path.abspath(<a href="http://f.name">f.name</a>)</div>
<div>'/some/path/file.ext'</div><div><br></div></div><br><div class="gmail_quote">On Fri, Jul 4, 2008 at 1:37 PM, Andrew Fong <<a href="mailto:FongAndrew@gmail.com">FongAndrew@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Newbie question:<br>
<br>
Let's say I open a new file for writing in a certain path. How do I<br>
get that path back?<br>
<br>
Example:<br>
<br>
>>> f = open('/some/path/file.ext')<br>
>>> some_function(f)<br>
'/some/path/file.ext'<br>
<br>
Does some_function(f) already exist? And if not, how would I define<br>
it?<br>
<br>
-- Andrew<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>| _ | * | _ |<br>| _ | _ | * |<br>| * | * | * |