views:

419

answers:

3

I need major help getting started! I managed to create a new project, and add python.exe as the interpreter. But when the project is created it's blank. How do I start programming? Ugh.

+4  A: 

Open a new text file and start writing code?

Amber
+2  A: 
  1. Create PyDev project
  2. Add "Source Folder" under the project
  3. Add "Modules" to the "Source Folder"
  4. Get coding :-)
jldupont
Thanks a lot! :D
Fabian
@Fabian: my pleasure! Is my answer satisfactory then?
jldupont
+1  A: 

You need to make sure you create a Pydev project. If you don't already have a Python interpreter installed, you'll need to get one (this is mainly a problem on Windows, ActiveState is a great commercial grade distribution, python.org also has some great free builds of Python.) Once this is complete, you'll need to get into your global Pydev preferences (not the preferences for your specific project, but for all Pydev projects) and select the interpreter of your choice. Pydev will automatically scan the libraries included with your interpreter distribution and make them available for code completion. Then, you'll need to create a source file in the 'src' folder that contains code. Run it by choosing a run configuration that matches up with your interpreter choice (regular old Python in your case, not Iron python or Jpython). Most entry point python modules will have a main function like in C/C++ that looks like this: http://stackoverflow.com/questions/419163/what-does-if-namemain-do

pokstad
Pydev interpreter global preferences can be found at: Window -> Preferences -> Pydev -> Interpreter - Python
pokstad
By default the 'src' folder is where user python modules are scanned so make sure to keep all your source files in that folder if working on a small project.
pokstad
Running a module: Run -> Run As -> Python Run (http://pydev.org/manual_101_run.html)
pokstad