Like all tutorials we too gonna start with HelloWorld.py
Like in Java we save files with ".java" as extension ,Python files are saved with .py as extension.
For writing Python we need to switch our perspective from java to PyDev ,we can do this by:
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".
Creating PythonTest project::
--------------------------------------------------------------------
1. Go to File → New → PyDev Project to start a wizard.
2. In the next window that appears, enter the name of project as "PythonTest" 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.
3. Create a new module ::
Select the project "PythonTest" which we just created and go to File → New → PyDev Module. This will launch a new PyDev Module Wizard where we should enter a name for your module as "HelloWorld" . Leave the Package field blank and select Finish.
4. The file should be opened in the open space in the center of the workspace-the Editor view. (If not, right click on the HelloWorld.py icon and select Open.) You will see a tab with the name of your file.
5. lets Write and run the program ::
Simply type print('Hello, World!') into the file. You may remove the default doc comment or leave it there; Python ignores it.
press ctrl+s or Right click on the file and select Save to save HelloWorld.py.
Finally, choose the HelloWorld.py icon, and go to Run → Run As → Python Run to run our program.
(A quicker alternative is to right-click on the HelloWorld.py icon, and select Run As → Python Run, or press Ctrl+F11.)
Everyone have a Look at the bottom of your screen at the Console view and you will see the message you told the computer to print.ie; Hello, World!
Congratulations everyone we have successfully configured our MyEclipse for the Python developement..... we ill start learning the Basics of Python from the next session.
Have a Good Day..Narendra Soni..!!
No comments:
Post a Comment