On September 14th, 2017, we published revised versions of our Privacy Policy, Terms of Service and Website Use Policy and published a Cookie Policy. Your continued use of Lynda.com means you agree to these revised documents, so please take a few minutes to read and understand them.

Operating on Boolean values

Boolean values in Python are the special True and False objects.…So if I say 5 == 5, I get the True value back.…And if I say 7 < 5, I get the False value back.…So True and False are special values. They're actually of a Boolean class.…If I say, type(True) <class 'bool'>.…And we have a couple of operators for dealing especially with Boolean values.…

So if I say True and False, like that, I get False.…If I say True and True, I get True.…If I say True or False, that's True.…If I say False or False, that's False.…So the and, and the or operators, the ones that are spelled out as words, are…especially Boolean operators.…These are different then the bitwise, and, or.…

So if I say True & True, like this, I get True.…The difference is that's a bitwise operator.…I'm doing bitwise arithmetic, as opposed to simply Boolean arithmetic.…I'm doing bitwise arithmetic, which is different then the Boolean operators.…So the Boolean operators are and and or spelled out.…And they're useful for things like this. If I have,…

Resume Transcript Auto-Scroll

Author

Released

7/29/2010

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.

Topics include:

A Python 3 quick start for experienced developers

Creating functions and objects

Using Python's built-in objects and classes

Repeating code with loops and iterators

Understanding and using conditional expressions

Creating sequences with generators

Reusing code with objects and libraries

Handling errors with exceptions

Skill Level Beginner

6h 35m

Duration

3,683,858

Views

Show MoreShow Less

Q: The installation process for the PyDev Eclipse plug-in doesn’t work as described in the videos. What should I do?

A: The version of Eclipse used in the recording of Python 3 Essential Training was Eclipse 3.5.2 (Galileo SR2) and the version of PyDev was 1.5.7. Soon after recording, the Eclipse project was updated to version 3.6, called Helios. As of this writing, the current version of Eclipse is 3.6.1 (Helios SR1).
Around the same time as these updates were being released, the PyDev project was updated as well. As of this writing, the current version of PyDev is 1.6.2. If you are using these most recent versions, the procedure for installing Eclipse itself has not changed, but the process documented in the videos for installing PyDev may not work.

Q: How do you install the pydev-interpreter in Eclipse Indigo on Mac OS X Lion? It's significantly different than what's shown in the video "Installing Python 3 and Eclipse for Mac."

A: Since this course was publishing, there have been upgrades to Mac OS X and Eclipse. In this scenario, after installing Python and Eclipse and the Pydev interpreter, there is a different directory to go to when modifying the preferences. As instructed in the movie (at around 6:40) restart Eclipse and then go to Eclipse > Preferences and drill down to Pydev > Interpreter - Python in the sidebar. Click New and in the Select interpreter dialog that opens, click Browse.

The Open dialog box will open, but does not appear to display your hard drive. You must press and hold the Command+Shift+Period keys. This will display all hidden files on your system. Navigate to the new path ~/Library/Frameworks/Python.framework/versions/3.2/bin/python 3.2 and click Open.

You should be able to proceed normally from there.

Q: When I try to install PyDev, it's not showing up in the Available Software window.

A: This can happen if the pydev.org/updates site is down.

You can manually download PyDev from the pydev.org web site, or from my site here:

http://python.bw.org/

Installation is simple. I've included instructions on my web site above.