<div class="gmail_quote">On 3 August 2011 16:24, reckoner <span dir="ltr"><<a href="mailto:reckoner@gmail.com">reckoner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":13k">Thanks. It works! For Windows users, you can use the win32api module to compress the pathname, especially useful if it has spaces in it:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
import win32api<br>
win32api.GetShortPathName ('C:\Documents and Settings')<br>
</blockquote></blockquote></blockquote>
'C:\\DOCUME~1'<br></div></blockquote><div><br>Is the short name needed to change directory? I wonder if this could be automated as part of the %cd magic.<br><br>Thomas<br></div></div>