http://wahnfried.net
지난 번에 올린 것처럼 PyDev 설정을 마치고 나니 순간 멍해지더군요. 프로젝트를 대충 만들어 보았는데 아무 반응도 없는 겁니다. 해서 PyDev의 메뉴얼을 좀 더 읽어보아야 했습니다. 우선은 아래에 있는 영문 메뉴얼을 참조하셔서 프로젝트 설정을 조금 해 주시면 이젠 정말로 파이썬을 돌릴 수 있게 된답니다 :-)
- 프로젝트 생성하기
Ok, now that your interpreter is configured, it is time to create a project. After opening Eclipse, go to the menu: file > new > project > Pydev > Pydev project. You should see the screen below:

New Project Image
In this screen, you have to decide the project name, its location and its type. Also, it will present an option saying 'Create default 'src' folder and add it to the pythonpath'. If you don't leave that option checked, you'll have to create the source folder(s) yourself after the project is created.
You may finish in this screen or go to the next, where you will be asked which projects are referenced from this one. This is very important so that code completion works correctly. Also, the 'reference' is only one level deep. i.e. If you have a project A which depends on B, which in turn depends on C, you will have to make a reference from A to B and from A to C. It works basically getting the paths from the referenced projects and adding it to the PYTHONPATH for the project you're creating.

Project References Image
http://www.fabioz.com/pydev/manual_101_project_conf2.html
- 모듈 추가하기
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.
IMPORTANT: if you had an earlier version of pydev installed, you must close the perspective and open it again, as older versions of it may not have everything needed for this example (to do that, make the perspective active, then go to the menu: window > close perspective)

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).

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:
- If you do not have a firewall that is blocking communication from the shell.
- If the timeout to connect to the shell is enough for your system (in the menu: window > preferences > Pydev > code completion).
http://www.fabioz.com/pydev/manual_101_first_module.html
- 실행하기
Ok, now that you're already up and running with Pydev Extensions, let's run a program from within Eclipse with Pydev.
For that, we will extend the module we created in the previous chapter with the following program:
if __name__ == '__main__':
print 'Hello World'
Then, to run the file you can:
- Use a shortcut: F9 for Python run or Ctrl+F9 for Jython run.
- Go to the menu: Alt + R + S + The number of the Run you wish (It can be Python, Jython, unit-test, etc).
NOTE: You can only run files that are in your project (so, you cannot run an external file -- this is an Eclipse limitation, and there are currently no ways of overcoming it).

Doing so, the console should be brough forward with the output of the code (if you had some exception raised, clicking on it would bring you to the code in the stack-trace).
After the first run, if you type Ctrl+F11, the last file ran is re-run. Or, if you type just F11, a debug session is started with your last run. Let's test this...
First, you'll need to add a breakpoint in the "print 'Hello World'" line. To do so, go to the line and type Ctrl+F10 and select 'Add breakpoint', then type F11. Doing so, will trigger you to go to the 'debug perspective'. You should say 'yes' to this dialog.

After saying yes, you should be brought to the perspective below.

In this perspective, the debug actions are activated and presented to you, so, you can use:
F5: Step into
F6: Step over
F7: Step return
F8: Resume execution
After the debug session, you can return to the previous perspective by typing 'Ctrl+F8' (this keybinding iterates through the open perspectives)... And while we are at it, 'Ctrl+F7' iterates through the views and 'Ctrl+F6' iterates through the editors.
http://www.fabioz.com/pydev/manual_101_run.html
자, 이렇게 여차저차 해서 GUI 예제도 띄워보고 하며 대략 1시간 정도를 갖고 놀았습니다. 헌데 아차 싶은것이, Python은 interpreter를 통해 돌리는 스크립트 언어였다는 것. 이걸 exe 형태의 binary 파일로 만들려니 약간의 가공이 필요하겠더군요. py2exe라는 멋진 녀석이 있는 것까지는 발견했습니다만, 아직 돌려보지는 않았습니다. 다음 번에는 py2exe로 실행 파일 만들기까지 진행해보도록 하겠습니다 :-) 오늘은 모두 붙여넣기 한 것들뿐이로군요;



Adidas NBA Jerseys , Cheap NBA Basketball Jerseys ,Wholesale NBA Basketball Jerseys ,
Adidas NBA Basketball Jerseys ,Throwback NBA Jerseys ,Authentics NBA Jerseys
Atlanta Hawks Jerseys , Boston Celtics Jerseys , Kevin Garnett Jerseys , Charlotte Bobcats Jerseys
chicago bulls Jerseys , Cleveland Cavaliers Jerseys ,Lebron James Jerseys ,Shaq Oneal Jerseys ,
Dallas Mavericks Jerseys ,Jason Kidd Jerseys , Denver Nuggets Jerseys , Detroit Pistons Jerseys
Houston Rockets Jerseys , Los Angeles Clippers Jerseys , Los Angeles Lakers Jerseys ,
Kobe bryants Lakers , Miami Heat Jerseys , Dwayne Wade Jerseys , Minnesota Timberwolves Jerseys ,
New Orleans Hornets Jerseys ,Chris Paul Jerseys , Orlando Magic Jerseys ,
vince carter Jerseys ,Dwight Howard Jerseys , Phoenix Suns Jerseys , Steve Nash Jerseys ,
Portland TrailBlazers Jerseys , Roy Jerseys , Sacramento Kings Jerseys , San Antonio Spurs Jerseys ,
Tim Duncan Jerseys , Utah Jazz Jerseys , Deron Williams Jerseys , Washington Wizards jerseys
Cheap basketball jerseys , Wholesale basketball jerseys , Discount basketball jerseys , Youth basketball jerseys
NBA basketball jerseys Sale ,NBA basketball jerseys for Sale