1
00:00:00,000 --> 00:00:05,990
Let's take a look at how you can install Python and the Eclipse environment on a Windows PC.

2
00:00:06,000 --> 00:00:12,990
I am using a Windows 7 PC here. This same procedure should work for any kind of modern Windows.

3
00:00:13,000 --> 00:00:18,990
This is the download page for Python 3.1.2. Use the downloader or installer for

4
00:00:19,000 --> 00:00:21,990
whatever version of Python is the latest.

5
00:00:22,000 --> 00:00:25,990
If I scroll down here, you will see that there is downloads available for a

6
00:00:26,000 --> 00:00:29,990
number of operating systems. I am going to pick the one for this Microsoft

7
00:00:30,000 --> 00:00:34,990
Windows box, and I have already actually downloaded this, so I have got that

8
00:00:35,000 --> 00:00:36,990
already in my Download folder.

9
00:00:37,000 --> 00:00:38,990
Let's also go ahead and download Eclipse.

10
00:00:39,000 --> 00:00:42,990
Now in order to install Eclipse, you must have Java installed, and you should

11
00:00:43,000 --> 00:00:45,990
probably have the latest Java installed.

12
00:00:46,000 --> 00:00:50,990
So I strongly recommend that you make sure that your computer has Java, and it's

13
00:00:51,000 --> 00:00:52,990
the latest version of Java.

14
00:00:53,000 --> 00:00:55,990
Windows machines do not necessarily come with Java already installed.

15
00:00:56,000 --> 00:00:59,990
So you need to make sure that you have Java installed before you install Eclipse.

16
00:01:00,000 --> 00:01:04,990
Eclipse is designed to be a development environment for the Java language.

17
00:01:05,000 --> 00:01:08,990
We are using it here to develop in Python because it has a lovely plug-in

18
00:01:09,000 --> 00:01:11,990
available for Python development, and that works really well.

19
00:01:12,000 --> 00:01:14,990
Here, on the download page for Eclipse, you will notice that there are a lot of

20
00:01:15,000 --> 00:01:19,990
choices, and any one of these will actually work. We are going to install the

21
00:01:20,000 --> 00:01:22,990
basic Eclipse Classic.

22
00:01:23,000 --> 00:01:26,990
Most of the time, when you hover over this link here whatever operating system

23
00:01:27,000 --> 00:01:30,990
you are working with, it will get the proper download for your operating system.

24
00:01:31,000 --> 00:01:34,990
If you are not sure, you can select the one that you want from this list over here.

25
00:01:35,000 --> 00:01:37,990
So let's go ahead and get started with the installation.

26
00:01:38,000 --> 00:01:41,990
First, we are going to install Python, and that involves double-clicking on this

27
00:01:42,000 --> 00:01:44,990
installer, and I will say Run.

28
00:01:45,000 --> 00:01:48,990
I'm going to go ahead and Install for all users, and I am going to install it in the

29
00:01:49,000 --> 00:01:52,990
default location, and I want to make a note where that is.

30
00:01:53,000 --> 00:01:57,990
That's Python31 folder, right off of the C disk.

31
00:01:58,000 --> 00:02:01,990
Again, I am going to accept the defaults. It's installing everything, and we want

32
00:02:02,000 --> 00:02:06,990
that, and then it just goes ahead and does its thing.

33
00:02:07,000 --> 00:02:10,990
Now let's go ahead and run IDLE and make sure that it works.

34
00:02:11,000 --> 00:02:17,990
There it is, so now we know that we have Python 3.1.2 installed, and it's working.

35
00:02:18,000 --> 00:02:19,990
Now we are going to install Eclipse.

36
00:02:20,000 --> 00:02:25,990
Eclipse comes to us in a zip file, so I am going to Extract All just to this

37
00:02:26,000 --> 00:02:30,990
default location in my Downloads folder.

38
00:02:31,000 --> 00:02:36,990
Now we have the eclipse folder, so I am just pressing Ctrl+N to open another

39
00:02:37,000 --> 00:02:42,990
Explorer window, and we'll come down here and find Program Files, and I am going to

40
00:02:43,000 --> 00:02:46,990
install it on Program Files (x86) because I don't loaded the 32 bit version.

41
00:02:47,000 --> 00:02:51,990
You can put it in the other one if you want to, and I am just going to drag this over

42
00:02:52,000 --> 00:02:53,990
here and move it to Program Files.

43
00:02:54,000 --> 00:02:57,990
So I don't want it to go in one of these other folders, so I am going to

44
00:02:58,000 --> 00:03:00,990
actually drag it into this part of the window here where it says move to Program

45
00:03:01,000 --> 00:03:05,990
Files, and I will Continue and authorize, and there it is.

46
00:03:06,000 --> 00:03:13,990
I will open this up, and there is eclipse.exe. I am going to pin it to the Start menu.

47
00:03:14,000 --> 00:03:17,990
Now, there it is in my Start menu.

48
00:03:18,000 --> 00:03:24,990
So I can close this window, I can close this window, and I no longer need this

49
00:03:25,000 --> 00:03:28,990
empty folder here. I will just go ahead and delete that.

50
00:03:29,000 --> 00:03:34,990
Now it's time to start Eclipse. There is still quite a bit left to do here. I am

51
00:03:35,000 --> 00:03:35,990
accepting that and running it.

52
00:03:36,000 --> 00:03:41,990
I am going to accept the default location for my workspace. I am going to say

53
00:03:42,000 --> 00:03:45,990
use this as a default so you don't ask me again. And you can put your workspace

54
00:03:46,000 --> 00:03:49,990
wherever it makes sense for you. And now we are running Eclipse but it's not

55
00:03:50,000 --> 00:03:51,990
ready to use at all yet.

56
00:03:52,000 --> 00:03:56,990
First thing we need to do is we need to install Pydev. That's the development

57
00:03:57,000 --> 00:04:00,990
environment for Python. And under the Help menu, you will see there is a

58
00:04:01,000 --> 00:04:05,990
selection for Install New Software, and before we can even type something in

59
00:04:06,000 --> 00:04:13,990
here, we need to click on this Available Software Sites preferences and Add a new software site.

60
00:04:14,000 --> 00:04:19,990
The URL for this is pydev.org/updates.

61
00:04:20,000 --> 00:04:26,990
We are going to call this Pydev, and say OK, and OK.

62
00:04:27,000 --> 00:04:30,990
Then up here, we can just start typing Pydev, and we will see that it comes up, so

63
00:04:31,000 --> 00:04:37,990
we select that, and it says Pending, and then we check on the one that says Pydev.

64
00:04:38,000 --> 00:04:42,990
You probably don't need this Mylyn Integration unless you know that you do, and

65
00:04:43,000 --> 00:04:45,990
if you are using Mylyn, by all means, go ahead and add that.

66
00:04:46,000 --> 00:04:49,990
So now I am going to say Next, and it found it, and so I am going to select that

67
00:04:50,000 --> 00:04:54,990
and press Finish. And now it's installing the Pydev development environment for

68
00:04:55,000 --> 00:04:57,990
Python within Eclipse.

69
00:04:58,000 --> 00:05:01,990
Say OK to the unsigned content warning, and it is strongly recommended -

70
00:05:02,000 --> 00:05:07,990
it says so right there - that you restart Eclipse, and there is no reason not to,

71
00:05:08,000 --> 00:05:07,990
so we will just say OK.

72
00:05:08,000 --> 00:05:13,990
All right, we are getting closer. So now we have some configuring to do.

73
00:05:14,000 --> 00:05:17,990
We are going to open the Preferences, which is under the Window menu, and we are

74
00:05:18,000 --> 00:05:21,990
going to come down here to Pydev and click on the little arrow, and then you

75
00:05:22,000 --> 00:05:27,990
are going to click on Interpreter - Python, and we are going to need to add our

76
00:05:28,000 --> 00:05:28,990
Python interpreter.

77
00:05:29,000 --> 00:05:34,990
So we will click New, and we will click Browse and remember where Python is.

78
00:05:35,000 --> 00:05:39,990
It's under the C drive and in Python 3.1, and there is our Python interpreter.

79
00:05:40,000 --> 00:05:45,990
Click Open, and we will just name this Python 3.1 and say OK.

80
00:05:46,000 --> 00:05:50,990
Now you will get this Selection Needed window. You just take the defaults and

81
00:05:51,000 --> 00:05:56,990
select OK Once you have all of this, you select OK, and this will take a few minutes.

82
00:05:57,000 --> 00:06:01,990
Now that you have configured the Python interpreter, you can create your first project.

83
00:06:02,000 --> 00:06:08,990
So under the File menu, you hover over New and you come down here and you select Project.

84
00:06:09,000 --> 00:06:12,990
Under the Selection Wizard, you click on the little arrow next to Pydev and you

85
00:06:13,000 --> 00:06:17,990
select a Pydev project and click Next, and you want to give it a Project name.

86
00:06:18,000 --> 00:06:25,990
I am going to call this Python 3 Essential Training, and you want your Grammar Version

87
00:06:26,000 --> 00:06:30,990
should be 3.0, and your Interpreter will be 3.1 Interpreter.

88
00:06:31,000 --> 00:06:35,990
Project type should be Python and click Finish, and it says it's the Pydev

89
00:06:36,000 --> 00:06:40,990
perspective. You can say Yes for that, and over here in the Perspectives, slide

90
00:06:41,000 --> 00:06:45,990
this over and right-click on the Java and click Close and slide it back over,

91
00:06:46,000 --> 00:06:48,990
unless you are actually going to be working in Java, in which case, you might

92
00:06:49,000 --> 00:06:49,990
want to leave that.

93
00:06:50,000 --> 00:06:54,990
So now we are going to add a folder to our project. I'm going to right-click on

94
00:06:55,000 --> 00:06:58,990
Python 3 Essential Training, and I am going to say New > Folder. I am going to

95
00:06:59,000 --> 00:07:02,990
click on Advanced and Link to folder in the file system, and then I am going to

96
00:07:03,000 --> 00:07:08,990
browse, and I am going to find my exercise files for this course and I put that in my desktop,

97
00:07:09,000 --> 00:07:13,990
and there is Exercise Files, and I will select OK, and so Link to folder in the

98
00:07:14,000 --> 00:07:18,990
file system is checked, and the parent is this Python 3 Essential Training. I am

99
00:07:19,000 --> 00:07:21,990
going to say Finish and there is my Exercise Files.

100
00:07:22,000 --> 00:07:25,990
So this did not copy the Exercise Files into my Project folder;

101
00:07:26,000 --> 00:07:29,990
It simply linked to it. And so, almost there. We are going to go back into the

102
00:07:30,000 --> 00:07:35,990
Preferences, and under Pydev and under Editor, we are going to find this

103
00:07:36,000 --> 00:07:37,990
thing called Hover.

104
00:07:38,000 --> 00:07:42,990
If Show docstrings is checked, you might want to uncheck it; you can try it both ways,

105
00:07:43,000 --> 00:07:46,990
but for my purposes in demonstrating, I have unchecked it.

106
00:07:47,000 --> 00:07:49,990
Feel free to try it both ways and see how that works for you.

107
00:07:50,000 --> 00:07:54,990
So what this does is when you hover over an object in Python, it shows the

108
00:07:55,000 --> 00:07:55,990
entire documentation.

109
00:07:56,000 --> 00:07:58,990
It pops up on the screen, and personally I find that this gets in the way.

110
00:07:59,000 --> 00:08:00,990
You may find it helpful.

111
00:08:01,000 --> 00:08:04,990
So feel free to try it both ways. I have got it unchecked on mine.

112
00:08:05,000 --> 00:08:10,990
Finally, under General > Editors > Text Editors, you want to make sure that

113
00:08:11,000 --> 00:08:13,990
Show line numbers is checked, because that's going to be useful.

114
00:08:14,000 --> 00:08:18,990
So we will select OK, and feel free to look through the Preferences and

115
00:08:19,000 --> 00:08:21,990
experiment with some of the other options. And now we are going to go ahead and

116
00:08:22,000 --> 00:08:28,990
just load up our Hello World program and run it. And so I will select Python Run

117
00:08:29,000 --> 00:08:30,990
and OK, and there we have it.

118
00:08:31,000 --> 00:08:35,990
So we have installed Python, we have installed Eclipse, and we have installed the

119
00:08:36,000 --> 00:08:39,990
Pydev development environment, and we have configured it so we can use it for

120
00:08:40,000 --> 00:08:42,990
Python development, and you can use this environment to follow along with the

121
00:08:43,000 --> 00:08:53,000
exercises in this course.

