If you have any Eclipse and you want to python environment in eclipse then you have to install plugin in eclipse then you can achieve environment of python and python related all module.
Because this plugin takes all software update which is installed in python. it will automatically configure when u install plugin.
Go through below steps
Step 1: Install python plugin in eclipse
In the next screen, add the update site(s) you want to work with ( See below for a list with the available update sites).
Main:
Nightly builds:
After entering the update sites, select the update site you entered or select "All available sites" and add a filter for PyDev, so that it shows the contents of all the update sites that have PyDev, then select what you want to install and click 'Next'.
Then, UNCHECK the 'Contact all update sites during install to find required software' and press 'Next' again to confirm your selection.
And finally, read the license agreement and if you accept, select the accept radio button and click 'Finish'.
At that point, Eclipse should automatically download the plugin contents and present you to a dialog asking if you want to restart (to which you should say yes).
Step 2: Configuration of Eclipse
You also have to maintain in Eclipse the location of your Python installation. Open in the → → → menu.
Press the
Because this plugin takes all software update which is installed in python. it will automatically configure when u install plugin.
Go through below steps
Step 1: Install python plugin in eclipse
Note: Instructions are targeted at Eclipse 3.5 onwards
To install Aptana plugin Extensions using the Eclipse Update Manager,
you need to use the Help > Install New Software... menu
To install PyDev and PyDev Extensions using the Eclipse Update Manager,
you need to use the Help > Install New Software... menu (note that in older versions,
this would be the 'Find and Install'
menu).
In the next screen, add the update site(s) you want to work with ( See below for a list with the available update sites).
Main:
Nightly builds:
After entering the update sites, select the update site you entered or select "All available sites" and add a filter for PyDev, so that it shows the contents of all the update sites that have PyDev, then select what you want to install and click 'Next'.
Then, UNCHECK the 'Contact all update sites during install to find required software' and press 'Next' again to confirm your selection.
And finally, read the license agreement and if you accept, select the accept radio button and click 'Finish'.
At that point, Eclipse should automatically download the plugin contents and present you to a dialog asking if you want to restart (to which you should say yes).
Step 2: Configuration of Eclipse
You also have to maintain in Eclipse the location of your Python installation. Open in the → → → menu.
Press the
python.exe
in your
Python installation directory. For Linux and Mac OSX users
this is
normally /usr/bin/python.
button
and enter the path to
-
Click "New..." and type Python32 for the Interpreter name.
For the Interpreter executable, browse to your copy of Python (C:\Program Files\Python32\python.exe),
and press Open.
Click "OK" and the Selection Needed Window will appear.
Writing Your First Python Program
-
Go to Window → Open Perspective → Other and choose
PyDev,
then click OK. If you look at the upper right corner you will see
that the perspective has changed from "Java" to "PyDev".
-
Perspectives are designed to have the most useful
tools within reach for whatever task you are doing
(for example writing Java code or writing Python
code). If you look in the File→ New menu you will see that there are different options with the different perspective.
PyDev Perspective Java Perspective
-
Go to Window → Open Perspective → Other and choose
PyDev,
then click OK. If you look at the upper right corner you will see
that the perspective has changed from "Java" to "PyDev".
-
Create a new project
- Go to File → New → PyDev Project to start a wizard.
-
In the next window that appears, enter the name of your project and select "python"
and 3.0"; as the type. Make sure "create default 'src' folder and add it to the pythonpath?" is selected. Click Finish.
-
If you look at the upper left corner of the workspace (in the
Package Explorer
view), you should now see your newly created project with a "src" folder inside.
-
Create a new module
-
Select the project you just created and go to
File → New →
PyDev Module.
This will launch a new PyDev Module Wizard where you should enter a name for your module and
make sure it is in the right location. Leave the Package field blank and select Finish.
-
Look in the Package Explorer view and you will see an icon of
your new file inside the src folder, which Eclipse created when you made
the new project before.
The file should be opened in the open space in the center of the workspace-the Editor view. (If not, right click on the greeting.py icon and select Open.) You will see a tab with the name of your file.
-
Select the project you just created and go to
File → New →
PyDev Module.
This will launch a new PyDev Module Wizard where you should enter a name for your module and
make sure it is in the right location. Leave the Package field blank and select Finish.
-
Write and run the program
-
Here's a program to greet the world. Simply type
print('Hello, World!')
into the file. You may remove the default doc comment or leave it there; Python ignores it.
-
Right click on the file and select Save (or press Ctrl+S) to save the file.
-
Finally, choose the greeting.py icon, and go to
Run → Run As → Python Run to run your program.
(A quicker alternative is to right-click on the
greeting.py icon, and select Run As → Python Run,
or press Ctrl+F11.)
-
Look at the bottom of your screen at the
Console
view and you will see the message you told the computer to print.
Congratulations! You have written your first program with Python.
-
Here's a program to greet the world. Simply type
No comments:
Post a Comment