Files
hpr-knowledge-base/hpr_transcripts/hpr1138.txt
Lee Hanken 7c8efd2228 Initial commit: HPR Knowledge Base MCP Server
- MCP server with stdio transport for local use
- Search episodes, transcripts, hosts, and series
- 4,511 episodes with metadata and transcripts
- Data loader with in-memory JSON storage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 10:54:13 +00:00

112 lines
8.7 KiB
Plaintext

Episode: 1138
Title: HPR1138: Programming languages 2 - Python
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1138/hpr1138.mp3
Transcribed: 2025-10-17 19:39:20
---
Howdy folks, this is 5150 for Hacker Public Radio.
Remember how much fun we had last New Year's during the 13 hour live podcast and party?
We're gonna have twice as much fun this year celebrating the full 24 hours of New Year's Eve
with guests from your favorite podcast and hosts around the world.
You're invited to join in on Mumble when you can and listen on the live stream when you can't.
The details will be posted on www.HackerPublicRadio.org.
Hi, my name is Garjola.
This is the second episode on a series about computer programming languages.
The first episode of the series, HPR-932, was a general introduction about programming languages.
In this episode, I will talk about the Python programming language.
But beware, I'm not going to try to teach you Python.
This is a very difficult thing to do via podcast, so I will just try to wear your appetite by talking about interesting aspects of Python.
I will give you the links which will allow you to do your homework.
Python is a very interesting language in the sense that it covers a very wide range of use cases.
It can be useful for simple scripting tasks that is automatic repetitive tasks that you usually do by hand.
It can also be useful for text file processing like parsing log files or specific formats like XML.
You can use it as a tool language that is the mix of system calls to common line programs like scripting,
but also by calling foreign language libraries which provide Python bindings.
You can use Python as a first language in a computer science curriculum,
since it is simple to learn and supports different programming paradigms,
auxiliary empty procedural functional, etc.
You can also use it as an extension language since a Python interpreter can be embedded in C or C++ programs.
Python being a very rich language with a very rich standard library, you can use it to build very complex applications.
There are many ways of using it to build complex graphical user interfaces,
since many graphical libraries provide Python bindings.
Python also provides a default library for graphical user interfaces, which is called TKInter,
and is based on TCLTK.
You can also use Python for web development either by using the standard library utilities
or by using one of the very popular frameworks like Soblon or Django.
Finally, Python is also extensively used in scientific computing,
since projects like SciPy, NumPy, or Matpodlib provide a set of tools,
which allow Python to be as powerful as languages like Matlab or IDL,
with the advantage of being a full-fledged language with a very rich standard library.
Personally, I started using Python in 1999.
I needed a good language, my main programming language was C++,
and I had generated a set of C++ executives that I needed to call for different tasks.
I found shell scripting horrible, and the main alternative at the time was Pearl,
and it was not object-oriented.
So since object-oriented program was a buzzword, which appealed very much to me at the time,
I needed something else.
So I started with Python, and I continued using it for more complex tasks,
like combining text file processing with object-oriented encapsulation of independent executable programs.
Recently, many in the last two years, I have started to move away from object-oriented programming,
and I have found other alternatives to Python for my needs.
May A still very much recommend Python as a first serious programming language.
Let's talk about the installation of Python.
There are two current versions of Python, version 2 and version 3.
Version 3 is not fully compatible with version 2,
so if you are starting with Python, I think it's wise to go with version 3.
But be aware that most existing applications and open source projects still use version 2.
If you are using a GNU-based system, chances are that Python is already installed on your system.
Otherwise, it will be available in your description repositories.
As far as I know, Python is also available on the Mac via the terminal.
On Windows, you will have to download a Python distribution from Python.org.
On the Python side, you will also find links for downloading Python for Linux, Mac OS, etc.
If you go to the Python side, you will notice that they mention alternative implementations of Python.
The implementation I will be talking about here is the one done in C.
To install Python, you can also download the source code and compile it yourself.
To give you some insight about the syntactic and semantics of the language,
I suggest you to have a look at the Wikipedia page.
I will read here some excerpts of the Wikipedia entry for Python.
Python is intended to be highly readable language.
It is designed to have an unclutter visual layout frequently using English keywords
where other languages use punctuation.
Python requires less boilerplate than traditional manifestly typed structure languages, such as CO Pascal.
It has a small number of syntactic exceptions and special cases than either of these.
The simplicity of Python is demonstrated by its version of the classic Hello World program,
which is something like print, open parenthesis, open quotes, Hello World, close quotes, close parenthesis, and that's it.
Python uses white space indentation rather than curly braces or keywords to the limit blocks.
An increase of indentation comes after certain statements like, if, while, for, and things like this.
And the decrease of indentation simplifies the end of the current block.
Python statements include, among others, the if statement, which conditionally executes a block of code,
along with else and L if, the first statement, which iterates over an iterable object,
capturing each element to a local variable for use in the attached block.
The while statement, which executes a block of code, as long as its condition is true,
the class statement, which executes a block of code and attaches its local namespace to a class,
is in object-oriented programming.
The death statement, which defines a function or a method,
the import statement, which is used to import modules whose functions or variables can be used in the current program.
Each statement has its own semantics. For example, the death statement does not execute its block immediately.
Python expressions are similar to other languages such as C and Java.
In Python, the double equal operator compares by value in contrast to Java, where it compares by reference.
Python uses the words n or not for its Boolean operator, rather than the C balls, ampersand, pipe, or exclamation sign like in Java and C.
In Python, methods and objects are functions attached to the object's class.
With respect to typing, Python uses stack typing and has type object and type variable names.
Python allows programmers to define their own types using classes, which are most often used for object-oriented programming.
Python is an interpreted language, that means that when you write a Python program, you give it to the interpreter,
which is going to execute the statement slide by line.
The section 3 of the Python tutorial, which is called an informal introduction to Python, and it's available on the Python side,
gives a very good overview of the use of the interactive interpreter.
Of course, if you are going to write long programs, you will want to save them to files, which can then be passed to the interpreter for execution.
Python has a very rich standard library, that is a set of modules which are part of the standard Python installation,
which provide many interesting functions, which in many other languages, are only provided by third-party libraries.
Examples of modules of the standard library in Python are the operating system interface, which allows to execute system calls,
model for dealing with command line arguments, error output reduction and prompt termination, string pattern matching,
mathematics, internet access, dates and times, that's a compression, performance measurement, output formatting, multi-threading, logging, etc.
With respect to documentation on tutorials, the mereference is the Python documentation page at docs.python.org.
There you will find a very useful tutorial. This is the place to start, and the standard library reference, and many other interesting information.
Okay, I think I'm going to stop here. In the next episode, we will have a look at Lisp, its history, and the main Lisp dialects, how Lisp, and the functional programming programming are going back to prime time.
In the meantime, if you have any comments, suggestions or corrections, you can get in touch with me by email at garjolaatgarjola.net.
That is garjolaatgarjola.net. Garjola is spelled g-a-r-j-o-l-a.
Thank you for listening. Bye-bye.
Thank you for listening.
Thank you for listening.