我创建了一个 python 项目,开始在 TextPad 和命令提示符中进行开发。
http://pydev.org/manual_101_project_conf.html
本文档简要提到了使用现有代码创建项目,但是我无法理解它......
它说: 创建项目,就像它是一个新项目一样,但保留创建默认“src”文件夹选项未选中并将位置指向源(或更高级别)——下一个教程页面将解释配置 PYTHONPATH 的步骤(应该在以这种方式创建项目后完成)。
这很有意义,所以我创建了一个新项目并已选择
不要配置 PYTHONPATH(稍后手动完成)
一切都很好,有足够的意义。因此,您可以导航到下一页,据说它说明了如何配置 PYTHONPATH,这应该以某种方式使该项目包含 src 文件???...
http://pydev.org/manual_101_project_conf2.html
据说此链接包含从现有代码创建项目的信息。它说明了如何创建源文件,很简单...所以我将现有代码复制到源文件夹中?
好吧,这工作得很好,我现在可以在 src 文件夹中运行我的模块,但它提到我应该将其添加到 PYTHONPATH 中。如果我的文件按预期运行,为什么我需要这样做?这样做有什么目的?
在这个过程中我还遗漏了什么吗?到目前为止,文档让我感到困惑......寻找基础知识,任何信息都会很棒
I have created a python project which I began development in TextPad and Command Prompt.
http://pydev.org/manual_101_project_conf.html
This documentation briefly mentions creating a project with existing code, but I can't make sense of it...
Is says: Create the project as if it was a new project, but leave the create default 'src' folder option unchecked and point the location to the location of the sources (or a level above) -- the next tutorial page will explain the steps to configure the PYTHONPATH (which should be done after creating the project this way).
which makes enough sense, so I created a new project and selected
Don't configure PYTHONPATH (to be done manually later on)
All fine, makes enough sense. So you can navigate to the next page where supposedly it says how to configure the PYTHONPATH, which should somehow make this project contain the src files???...
http://pydev.org/manual_101_project_conf2.html
Supposedly this link contains information to create the project from the existing code. It says how to create a source file, easy enough... So I take me existing code and copy it into the source folder?
Well this works well enough, I can now run my modules inside the src folder, but it mentions I should add it to the PYTHONPATH. If my files are running as expected why do I need to do this? What purpose does that serve?
Is there anything else I'm missing in this process? The documentation just confuses me so far... Looking for the basics, any information would be awesome
发布评论
评论(1)
根据我的经验,在 PyDev 中配置 PYTHONPATH 有两个主要兴趣:
From my experience, configuring the PYTHONPATH in PyDev has two main interests :