MCS 260 Fall 2020
Emily Dumas
Python is primarily an interpreted language, meaning that you write a program in the language, and then another program (e.g. python.exe
) reads and executes it.
In Python, distributing your program typically means distributing the .py
files you wrote (the source code).
No OS can run .py
files directly.
C and C++ are compiled languages, meaning that you write a program in the language, and then a program called the compiler translates this source code into an executable, a file the OS can execute directly.
E.g. the compiler turns prog.c
(source code) into prog.exe
(executable).
You can distribute an executable without sharing the source code.
Python actually interprets programs in two steps. First they are converted to a compact representation (bytecode). Then, another part of the interpreter runs the bytecode. The interpreter is required for each step.
This means you can distribute bytecode (.pyc
files) instead of source code.
The rest of this lecture talks about laws in the USA, but it is not legal advice. I am not a lawyer.
Copyright is a set of protections granted to authors of "original works" for a certain time after creation.
Software in source code or executable form is protected by copyright. The creators of the software are considered the authors.
Key point: Software you write is automatically and immediately protected by copyright.
Copyright provides the authors the exclusive right to:
If you find some code on the internet and there is no accompanying information that grants you permission to do the things below, then they are typically prohibited:
A software license is a document that grants a person, group, or entity rights to use a piece of software in certain ways.
Usually a license will permit certain actions that would otherwise be prohibited by copyright protections.
Whenever you find a program or source code file on the internet, look for a license that applies to you!
I write an inventory management program in C++.
I license the executable to everyone to use and distribute, but I do not share the source code.
For a fee, I license the source code to one company so they can modify it for their own purposes.
An important class of software license is an open source license, which grants anyone permission to:
(Other actions may still be restricted.)
There isn't universal agreement about the definition of "open source", but the definition from the Open Source Initiative is often used.
Software that is not open source is proprietary.