[Tutor] Help Noob Question

Alan Gauld alan.gauld at btinternet.com
Fri Mar 28 02:17:40 CET 2014


On 27/03/14 21:01, Chris “Kwpolska” Warrick wrote:
> On Mar 27, 2014 8:58 PM, "Alan Gauld" <alan.gauld at btinternet.com
> <mailto:alan.gauld at btinternet.com>> wrote:
>  >
>  > On 27/03/14 06:43, Leo Nardo wrote:
>  >>
>  >> Im on windows 8 and i need to open a file called string1.py that is on
>  >> my desktop,
>  >
>  >
>  > Thats your first problem. Its usually a bad idea to store your python
> code on the desktop, because the desktop is a pain to find from a
> command line.
>
> Painful? How painful can `cd Desktop` be? Certainly less than `D:`
> followed by `cd PythonProjects`…

Because the desktop is hardly ever anywhere near where the cmd prompt 
lands you.

So cd desktop usually results in an error and typing the full path (even 
with directory completion, Mark) is a royal pain because
you have to remember where it is. There is no ~ shortcut in Windows.
On my system that means typing something like:

C:\Documents and Settings\alang\Desktop

or some such nonsense, complete with spaces in the path that add
to the pain.

Now I probably could use something like cd %HOMEPATH% to get to what 
Windows laughingly considers my 'home' directory and then find it
from there but even so its not always obvious depending on the
windows version and the install options used. And of course if
the file happens to be on the "all users" Desktop looking in my
local Desktop doesn't help.

I find it much easier to know where my Python code lives from wherever I 
happen to find myself in the labrynthian file system that is Windows.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list