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 Mac running OS10. Here we have the Python download page, and I've already downloaded Python 3.1.2 Mac OS10 installer disc image. And, if you're coming to this page and there's a later version here, use the later version. That's not going to impact how the course operates, and you're going to want to be using the latest version. Of course, Mac OS10 already comes with Python. And that's a Python in the Python two branch.
This course is using Python three. We're teaching Python three, so you're going to need to download and install this anyway, and I'll show you how to go ahead and install that alongside of the existing Python that's on your Mac already. Over here, I have the Eclipse download page. Eclipse is an integrated development environment, and we'll be using that for instructional purposes here in this course. This course, of course, is about Python, but we'll be using Eclipse IDE as a tool as we work in Python.
Eclipse is writen in Java, it's designed for Java, but it works well for many languages. A lot of people use it as their main IDE. It's multi-platform. It's very mature and well-tested. The Eclipse in the rest of the course is Eclipse from the 3.5 branch. And here I'm going to show you how to install Eclipse 3.6, because that's the current one, and that's what's being used. And the installation is a little bit different. But the usage of it, how it's going to work, is pretty much the same, so you shouldn't have any problem following along with the exercises.
There's a lot of different versions of Eclipse here. If you're using Eclipse for another purpose, feel free to use one of these other versions. I'm going to be using the classic version. I'm going to download the classic version, and I'm going to select this one, Mac OS10 64-bit. That's for the modern Macs running with an Intel processor. So I've already downloaded these files, and here they are in my downloads folder. We're going to start by installing Python. That's because our Eclipse installation will depend on the Python installation.
I'm going to go ahead and double-click on this to open the DMG. And there it is. I'm going to double-click on the Python M package. And press Continue, and Continue, and Continue, and Agree. Be sure to read the license; that's important. And Install. I'm just going to accept the default location. Type my password. And the installation was successful. So I will eject that. And then I'm going to come over here to my ...
I'm going to press Command N to get a new finder window. I'm going to come over here to Applications, and I'm going to find Python. There's Python 3.1. You'll notice this program called IDLE. We're going to be using that. It's a little shell for Python. So I'll drag that down into my dock here, and I'm going to click on that to run it. And you'll notice that is says Python 3.12. That confirms that our installation was successful.
We'll go ahead and close that for now. IDLE, quit. And we'll close this, and we'll go on to installing Eclipse. So I'll double-click here on the Eclipse archive, and that will un-archive it. And then I'm going to drag this entire folder over into my applications. And come over into Applications, find my Eclipse folder, and come in here. And I'm going to drag this Eclipse application down into my dock.
And we'll put that one right there. And I'm going to run it. I'll accept this, that I did just download it. I knew that already. I'm going to accept the default location. You can put this wherever you like, but I'm going to accept the default location and check this 'Do not ask again.' And now, here's our main Eclipse window. I'm going to go right up here to Help, and I'm going to install the PyDev development environment for Python within Eclipse.
Select Install New Software. We'll click on the Add button here, and under Add Repository, I'm going to type PyDev ... right there, for the name. And the location is PyDev.org/updates. We'll select Okay. So at this point, we're not going to be installing the Mylyn integration, so you don't want to check that, you just want to check this here. You want to open this little triangle and make sure that there's not something here about a Django Templates Editor.
If there is, make sure that that's not checked. So, I have just the PyDev for Eclipse. That's all I want at this point. I'm going to go ahead and click Next. So our item details here is correct. We just have PyDef for Eclipse. I'm going to click Next again, and I'm going to accept the terms of the license agreement and click Finish. You notice there's things going on in the background there, and that's fine. And it says, "Installing Software." That could take a moment.
At some point, you'll be asked to accept a certificate from Optana, and you just check it and say Okay, because that is indeed the author of this software. And now it's suggesting that you restart the Eclipse SDK. You really want to do that. It causes problems if you don't. So you're going to go ahead and select Restart Now. Now we have this screen here, which is our Welcome screen for Eclipse. We're just going to go straight to the workbench, which is right up there at the top, and I'm just going to maximize this.
The first thing I'm going to want to do here is select the PyDef perspective. So I'm going to select this little button here, next to where it says Java. I'm going to say Other. And I'm going to select PyDef and Okay. Now you notice we have two of them. I'm going to right-click on the Java one and say Close, because I'm not going to be using Java. I'm just going to scooch this over to the side there a little bit. Now we have our PyDev perspective installed. Before we're done, though, we need to do a few things to complete this installation. We're going to Preferences and, under PyDev, going to select Interpreter Python.
You'll notice that there's nothing here. We need to add the Python Interpreter. So I'm going to press New, and I'm going to select Browse ... going to go to MacIntosh hard drive, and scroll down here to find User -- USR, not Users, plural. USR and Local, and Bin, B-I-N ... and we're going to select Python 3.1. It says that that's an alias, and that is correct.
I'll say Open, and you'll notice that it expands it. It goes through the alias tree and it finds the actual code there, which is exactly what we want it to do. So under Interpreter Name, we're going to type Python 3.1. Select Okay. And so this is exactly the result that you want. If it looks mostly like that, you're good. And just select Okay. And there we have our Python Intepreter. Now, if you're also going to be working in Python two, you might want to also install the Python two Interpreter.
We're not going to be doing that. We're just going to be working in Python 3.1 at this point. So we're done with this part of it. But we're not quite done with the configuration. I'm going to come into the Editor here and I'm going to select the one here that says Hover, and I'm going to uncheck Show Doc Strings. This is a personal choice. I find it really annoying. Some people probably find it helpful, which is why it's there, and it's there by default. But what this is is, whenever you hover your mouse over something in Python, it brings up a little pop-up with the entire documentation for whatever that thing is.
For our purposes, I find it really distracting, so I'm unchecking it. You know that it's there. You can leave it; you can try it both ways and decide what works for you. And then, finally, up here in General and under Editors, and Text Editors, I'm going to check Show Line Numbers. I find that really, really helpful. Now we'll say Okay. It's going to do a bunch of work here. And there we have it. So now we're going to go over here to the Package Explorer, and I'm going to right-click just there inside of it and say New Project.
I'm going to select PyDev and PyDev Project, and say Next. Under Project Name, I'm going to type Python 3 Essential Training. Grammar version is 3.0, and Interpreter is 3.1. And that's our new project, so we'll say Finish. And then I'm going to right-click on the project, and I'm going to say New Folder.
And then, under Advanced, I'm going to click on Advanced. I'm going to say link to alternate folder location. Linked folder. And then, under Browse, I'm going to go to the desktop, and there's our Exercise files. So if you have your Exercise files someplace else, you want to navigate to that. I'll say Open. What this does is, it'll link to the Exercise files, and it'll allow us to use it in place without making a copy of it and moving it to our workspace.
So I'm going to say Finish there. And there we have it. There's our Exercise files. So under Chapter Two, we're just going to double-click on hello.py, and there we have out Hello world. So the entire purpose of Hello world is to check your environment and make sure that you know exactly what you're doing. It's a very, very small, simple piece of code, so that can not be a part of the equation, and yet you can find out, do I have all of the things that I need, and do I know how they work, and are they working properly in order to actually run some Python code inside of this environment? I'm going to click on Run, which is this big green button here, and I'm going to select Python Run in this Run As, and say Okay.
And there we have it. We got our result. This means that Python is installed and it's working, Eclipse is installed and it's working, PyDev is installed and it's working, the Python Interpreter is configured, and the entire environment is working together. So at this point, you now have a working Eclipse environment where you can follow along with the exercises and use it to do your own development.
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.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.