|
Last Site Update: 02 October 2008 | Latest Version: 1.3.22 |
|
|
|
|
|
|
|
|
|
|
||||||
Creating our first module (now that the interpreter and the project are already configured).
To make things easier, make sure that you are in the 'pydev perspective' -- it is 'automatically' opened when you create a pydev project, but
just in case, you can open it by going to the menu: window > open perspective > other > pydev, as pointed in the picture below.
A perspective 'defines' what appears in your window and which actions are enabled... If you want to add something (even some menu), you can go to the menu: window > customize perspective. To create our first module, we will use the default pydev perspective, as it already has the wizard shortcuts pre-defined in the 'file > new' menu First, we will start creating a new package in a project named 'test' (it was created with the default 'src' folder, and all the code should be put underneath it). So, let the 'src' folder selected and go to the menu: File > new > pydev package and fill the package name as below (the source folder should be automatically filled)..
If everything goes ok, the structure below will be created (and the file /root/nested/__init__.py will be opened). Note: Check to see if the 'P' icon is appearing for your items (as in the picture below) and in the top of your editor after opening it. If it's not appearing, check this bug report to see how to fix it.
Now, let's create the 'example' module. Let the folder /root/nested selected and go to the menu: File > new > pydev module and fill the module name as below (again, the other fields should be automatically filled).
The file '/root/nested/example.py' should have been created, so, to finish this example, in the empty file, press Ctrl+Space (that's the shortcut for the pydev code-completion). Once you do that, the 'context-sensitive' completions should appear (as below).
NOTE: If the code-completion does not work, you should check:
NOTE FOR JYTHON USERS: If you are in jython, the first activation might take a while. This usually happens when jython has to do the processing
of new jars. The next time you start it, if it takes the same time, it could be that your jython 'cache-dir' is not writable, so, you can
create a script with the code below to see where is the cache dir and check its permissions (or if there is no permission problem, you can try deleting the dir and
seeing if it gets correctly recreated in the next jython activation).
|
|||||||
|
© Copyright: Aptana, Inc. 2008 |