3

I am a real beginner learning to use Python using Zed Shaw's "Learn Python the Hard Way". Until now, I had no codes that gave me error as long as I typed in exactly the same way, but here in Exercise 46, I am having trouble setting up my skelton project. In the book, it says to type:

$ mkdir -p projects<br/>
$ cd projects/<br/>
$ mkdir skeleton<br/>
$ cd skeleton<br/>
$ mkdir bin NAME tests docs<br/>

I have already checked this Learn Python the Hard Way: Exercise 46 but I could not do the last line "mkdir bin NAME tests docs". It (I am using Windows PowerShell) gives me an error saying:

"mkdir : A positional parameter cannot be found that accepts argument 'Name'.<br/>
At line:1 char:6<br/>
+ mkdir <<<<  bin NAME tests docs<br/>
    + CategoryInfo           : InvalidArgument: (:) [mkdir], ParameterBindingException<br/>
    + FullyQualifiedErrorID : PositionalParamaterNotFound,mkdir<br/>

Could anybody please tell me what is going on and how I can fix this? I am sorry this is really a basic question but is "$ mkdir bin NAME tests docs" trying to make multiple directories named "bin", "NAME", "tests", and "docs"?

Community
  • 1
  • 1
owl
  • 1,841
  • 6
  • 20
  • 30
  • 1
    Are you typing "$ mkdir bin NAME tests docs" or "mkdir bin NAME tests docs"? – Jerome Jul 13 '12 at 20:06
  • 1
    @Jerome: `$ ` is a common command prompt symbol, last I checked, so the latter is more likely. Particularly as the question later states that the line tried is "mkdir bin NAME tests docs". – JAB Jul 13 '12 at 20:09
  • Thanks for your quick response! No, I do understand that I should not type in $ (> for Windows). – owl Jul 13 '12 at 20:11
  • @JAB I'm aware of that, wanted to make sure owl was too :) – Jerome Jul 13 '12 at 20:14

3 Answers3

8

You can just as easily do mkdir bin,NAME,tests,docs

Hans Z
  • 4,664
  • 2
  • 27
  • 50
  • Thanks! That worked on PowerShell. So in PowerShell, you need commas between new directories you want to create! – owl Jul 13 '12 at 20:17
  • alternatively if you can trick shell into thinking that it's one command argument using `mkdir ./{bin,Name,tests,docs}` – Hans Z Jul 13 '12 at 20:20
  • Gave me the same error I wrote above... But the one you told me above worked! Thank you so much all, for such quick responses!! – owl Jul 13 '12 at 20:22
1

Use the normal Windows command-line. It works fine there. (Well, on Windows XP, at least. Don't see why it would be different for Vista or 7, though.)

(Though as others have pointed out, you could still use Windows Powershell if you just separate the directories to make with commas.)

JAB
  • 20,783
  • 6
  • 71
  • 80
  • Works fine with Windows 7 as well. – Joel Cornett Jul 13 '12 at 20:09
  • Thanks, I just tried normal Windows command-line and it did work there. It did what I thought it would, just not on PowerShell, which was what I have been using for these exercises. – owl Jul 13 '12 at 20:15
0

I think it should be

mkdir bin\<Project Name>\tests\docs\

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179
  • That doesn't match the desired directory layout at all. – JAB Jul 13 '12 at 20:14
  • @owl Interestingly, while this one doesn't actually do what you want, it also works without errors in `cmd.exe`. I wonder why the PowerShell designers decided to have it be incompatible in that manner with vanilla command-line argument styles. – JAB Jul 13 '12 at 20:20
  • I have no idea why... I was recently threw in an entirely new world (for me) of command-line, programming etc. This was the very first time I used this but I cannot believe how quick and helpful people were! Thank you so much, all!! – owl Jul 13 '12 at 20:26