> I am trying to programmatically create a Python project and add some
> source code to it, but I don't know how to configure the project. When
> it comes to Java projects, here's more or less what one would do:
>
> ...
>
> My question is how would I do something  like this for a Python project?
> In other words, what variables should I set in the project's build path?
> Is there something like JavaCore for PyDev?
>

Hi,

Pydev only has one active interpreter (one for python and one for
jython), so, you only need to set the project type... aside from that,
you have to create/set the source folder(s).

So, after creating the IProject / IFolder(s) you want, just add the
PythonNature...

e.g.: To add a jython 2.1 nature to a project with a 'src' folder and
a 'junit.jar' file in the pythonpath (project name:
'pydev_unit_test_project'), you would do:

import org.python.pydev.plugin.nature.PythonNature;

...

PythonNature.addNature(project, monitor,
PythonNature.JYTHON_VERSION_2_1,
"/pydev_unit_test_project/src|/pydev_unit_test_project/junit.jar");

That's been taken from:
org.python.pydev.editor.codecompletion.revisited.javaintegration.AbstractJavaIntegrationTestWorkbench
(this test sets up the whole pydev-needed structure, configuring the
interpreter and projects, so, it's probably a good example on how to
configure things in pydev).

Cheers,

Fabio

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
pydev-code mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-code

Reply via email to