Viewers: in countries Watching now:
Due to its power, simplicity, and complete object model, Python has become the scripting language of choice for many large organizations, including Google, Yahoo, and IBM. In Python 3 Essential Training, Bill Weinman demonstrates how to use Python 3 to create well-designed scripts and maintain existing projects. This course covers the basics of the language syntax and usage, as well as advanced features such as objects, generators, and exceptions. Example projects include a normalized database interface and a complete working CRUD application. Exercise files accompany the course.
In this movie, we'll be installing Python and Eclipse on a PC running Windows 7. In here we have the Python download page. And I've already downloaded the Python 3.1.2 Windows X86 MSI installer. That's the 32 bit version. And even if you're on a 64 bit capable machine, I'm probably going to recommend that you run the 32 bit version, and we'll get to why in a moment. First we're going to look at the eclipse download page.
Eclipse is an integrated development environment, an IDE. It's written in Java, and it's designed for Java, but it works well with a number of languages. You'll notice that there's all kinds of different packages for different types of development work here on the Eclipse download page. Now, if you're doing development in Eclipse and you're using a different version of Eclipse, PHP version or the C++ version, or the Java version, that's fine. You can go ahead and use that and install the PyDev development environment inside of that and that will work just fine.
For my purposes, I'm using Eclipse Classic because I'm only going to be using it here as a Python development environment. And so we download the classic version and we install the Python tools on top of that. I've already downloaded the 32 bit version of Eclipse. Eclipse is written in Java and it requires the Java run time environment in order for it to run. Most PCs do not come with Java, so I've downloaded install Java and you will need to download an install Java before you install Eclipse.
Unless you have downloaded and installed the 64 bit version of the Java run time environment, and you know that you have that 64 bit version working, you're going to need the 32 bit version of eclipse. Because the default java run time environment on Windows, even for Windows 64 bit machines, so unless you know that you have the 64 bit version of Java, and you know you have that running, you're going to need the 32 bit version of Eclipse. And if you're running the 32 bit version of Eclipse, I suggest you also run the 32 bit version of Python cause it'll be running inside of Eclipse.
Now, this course is using Eclipse version 3.5 and I'm going to be showing you how to install Eclipse version 3.6. The reason for that is that the install procedure has changed a little bit with this latest version of Eclipse, and you're probably going to be downloading the later version. It works pretty much exactly the same as the other version, so you'll be able to follow along with the exercises. We're going to start by installing Python first. Come over here to my downloads folder. I'll go ahead and say yes. And I'll go ahead and install for all users.
And I'm going to accept the destination directory, the default destination directory. But I want to just make sure I know where that is. So that's off of the local disk C, and right off of there in Python 3.1. So I know where that is, and I'll go ahead and just install the default feature set. And this'll just take a few minutes. So there, we've installed Python. I'm just going to say finish there. So I'm just going to bring that up under Python. Pin the idle program under Python to my Start Menu by dragging it down here.
Pin to the Start Menu and come back up and click on idle. And there we have Python version 3.1.2 and that's exactly what we're looking for. We've now successfully installed Python. And now, we're going to install Eclipse. You're going to right click on the Eclipse zip file here and say extract all. And it's going to show the extracted files when complete, that's exactly what I want. So now it's extracting the files. And there we go. Now we have this folder inside of our downloads folder, this Eclipse folder.
And inside of that, there's one folder called Eclipse. And what I want to do is I want to move that into my programs files and I am going to put it in my X86 version here. And so I just drag this over and move to program files X86 and say continue. And then I open the program files X86 and open the Eclipse folder and there is my eclipse.exe. I'm going to right click on that and pin it to the start menu. And then when I come over here to the start menu, there it is.
So I'm going to close this. In the downloads folder, I'm going to go ahead and delete this empty folder here, cause that doesn't have anything in it. You see that's where we just moved something out of. So I'm going to go ahead and delete that. And I don't need this anymore and I don't need the browser anymore. And now we're going to run Eclipse and we're going to do some set up inside of Eclipse. So we'll accept the default workspace here. You can put it someplace else if you like. I'm just going to check the use this default and do not ask again.
And there is Eclipse. The first thing we're going to do here is come up to the help menu and install new software. Now we'll get this Available Software screen. I'm going to click on Add. And in here I'm going to type, PyDev, like that. And in Location, I'm going to give it, pydev.org/updates. And I'll say OK. Here, I want you to open this up, this PyDev here. As long as you just see this one thing, PyDev for Eclipse, that's really all you want to have checked.
Under some circumstances, there are maybe another item, there was in some versions of PyDev that said PyDev Jingo Templates Editor, you want to make sure that's not checked and you don't want to check this Mylin either. In this case, because it's the only one, it's automatically checking the whole tree and that's okay because there's just the one thing in it. You want to make sure that you're just installing PyDev for Eclipse and not anything else. And now we get the review the items box here and we just say next because that's got the one item in it, which is exactly what we want. I'm going to accept the terms of the license and press finish.
We'll get this certificate acceptance, Apptha is the developer of this PyDev extension. So we'll select that and say OK. And now we're going to restart Eclipse. It gives the option here and it's just a really, really good idea to go ahead and restart it. So I'm going to select restart now. So now we're going to come to the Window menu and select preferences. First thing we're going to do, is we're going to configure the Python interpreter. So we come under the Pydev, and select interpreter Python. I'm going to need to extend this a little bit.
So we get all the menus there. And I'm going to say new. And I'm going to browse to Disk C and select Python 3.1 and there is the python.exe. Okay there. And type in here, Python 3.1. And say okay. And it goes and it finds all this other wonderful stuff and that's exactly what it needs to do. And I'm going to say OK from there as well. Before we go any further, there's just a coupe other things we want to configure here.
Under PyDev, we want to open up editor. And you'll see this one that says hover. And you'll notice that there's two options here. One of 'em says show doc strings and the other one is variables while debugging. And the doc strings one is the one that I'm going to uncheck. What this does is every time you hover over something in Python for more than a moment in your Python source code, it pops up the complete documentation for that thing. You're welcome to try it if you like. Under the general settings here, I'm going to open this one up, and I'm going to come down to editors and Text Editors.
And under Text Editors here, I'm going to check Show Line Numbers. That's something that I find very, very helpful. And I'm going to press OK, and it's going to go in and configure Python. Here under Perspectives, I'm going to select this, and I'm going to say Other and select the PyDev perspective, because that's what we're going to be using. And then I'm going to right click on Java and go ahead and close that cause we're not going to be using that. And just scoot this guy over, make it look really nice. And now we're going to configure our project.
Over here under the package explorer, I'm going to right click in that space there and say new project. And I'm going to select the PyDev project, open that up and next. And this project name will be called Python 3 central training. The grammar version is going to be 3.0 and the interpreter is going to be Python 3.1. And then we'll select Finish. And there's our project. And then, inside of our project. So I'm going to right-click on the project there.
I'm going to say New > Folder. And under New Folder here, I'm going to select Advanced and I'm going to select Link to alternate location, Linked Folder. And we'll browse for that. And now on my desktop here, you see the exercise files, that's what we're going to select. And I'll say okay. And now we're going to be linking to the exercise files, not copying it into a work space. We're actually going to be using the exercise files in place on our desktop. But it's going to show up inside of our project, and that's exactly what we want to have happen.
So I'm going to say finish. And there's all of our exercise files. So let's open up chapter two and find the one that says hello.py and double click on that. There we are. And now we have our Python code here inside of Eclipse. Now this is a little Hello World. And the whole purpose of Hello World, I'm sure you've seen it before, is to test your develop environment. You want to be sure that everything's working and you have the simplest piece of code so that that can effectively get out of the way while you pay attention to your development environment here.
So, we just installed a whole lot of new stuff, we want to make sure that that is working. And I am going to come up here to the top and I am going to click this run as and I am going to select Python Run and okay. And there is our results, hello world. That's all working. That means that Python is installed and working, that Eclipse is installed and working, PyDev is installed and working, the Python interpreter is configured and working properly, and the entire environment is working together.
So, we have now successfully installed all of that and we have a working development environment for Python in Eclipse
Find answers to the most frequently asked questions about Python 3 Essential Training .
Here are the FAQs that matched your search "" :
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.