简体   繁体   English

创建框架项目目录

[英]Creating a skeleton project directory

I am a rookie in Python who has been working on Learn Python the Hard Way. 我是Python的新手,他一直在努力学习Python。 This whole process goes well as I have a smattering knowledge on Python until I march into ex46 where I get stuck in the 'Creating the skeleton Project Directory' section. 整个过程进展顺利,因为我对Python有一点点了解,直到进入ex46为止,在那里我陷入了“创建框架项目目录”部分。 I have no idea where I should run those commands guided on this book. 我不知道应该在哪里运行本书指导的那些命令。 Following are the excerpt of this part: 以下是本部分的摘录:

First, create the structure of your skeleton directory with these commands: 首先,使用以下命令创建骨架目录的结构:

 $ mkdir projects $ cd projects/ $ mkdir skeleton $ cd skeleton $ mkdir bin $ mkdir NAME $ mkdir tests $ mkdir docs 

I have tried to run these commands in Windows Powershell, only to be warned that these commands can't be recognized. 我试图在Windows Powershell中运行这些命令,只是警告您无法识别这些命令。 I also fumbled to execute them in Pycharm, but all in vain. 我也摸索要在皮查姆处决他们,但徒劳无功。 Could someone point out how I could get it done? 有人可以指出我该怎么做吗?

In addition, I am somewhat curious about this method because there seems to be handy way to approach this on Pycharm. 另外,我对此方法有些好奇,因为在Pycharm上似乎有方便的方法。 Could I achieve the same goal on that? 我可以在这个目标上实现相同的目标吗?

I am using Python 2.7 and all previous exercises operate well until ex46. 我使用的是Python 2.7,以前的所有练习在ex46之前都能正常运行。

You get that error because you're typing a superfluous $ at the beginning of each command. 之所以会出现此错误,是因为在每个命令的开头都键入了多余的$ That $ is the (Linux) command prompt . $是(Linux) 命令提示符 On your Windows machine, it's something like C:\\WINDOWS\\system32> . 在Windows计算机上,它类似于C:\\WINDOWS\\system32> Don't type that. 不要输入。

Just type 只需输入

mkdir projects 

and press Enter . 然后按Enter That creates a folder (directory) named "projects". 这将创建一个名为“ projects”的文件夹(目录)。 Then type 然后输入

cd projects

and press Enter . 然后按Enter That changes the current directory to that new folder you just created. 这会将当前目录更改为您刚刚创建的新文件夹。 And so on. 等等。

Content migrated from comments since this is what actually solved the issue. 内容已从注释迁移,因为这实际上解决了问题。

Remove the dollar sign $ from the statement, as this is just the symbol used as a CLI prompt not part of the statement itself. 从语句中删除美元符号$ ,因为这只是用作CLI提示符的符号,而不是语句本身的一部分。

Then type the mkdir command and it should work eg 然后键入mkdir命令,它应该可以工作,例如

mkdir my_directory

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM