python fundamentals

NEUR0680 | Jan 29, 2025

many options

  • Software comes in two main varieties
    • Free (often, but not always, open source)
    • Commercial (often, but not always, proprietary)

What does free mean?

many options

  • In the world of programming, the toolbox is incredibly large
    • Specialized vs general purpose
    • Compiled vs interpreted

kinds of programming languages

Interpreted languages

  • An interpreter reads and executes code directly
  • The interpreter (a program) must be present at run time
  • Popular examples include Python, R, Javascript, MATLAB

Compiled languages

  • A compiler turns code into an executable
  • The compiler (a program) need not be present at run time
  • Popular examples include C/C++, Fortran, Java, Visual Basic

 

The top 10 languages in
TIOBE's October 2025 ranking

"Python ends C and Java's 20-year reign atop the TIOBE index"

Source: techrepublic

In 2021...

Very long term history

Interpreted
Compiled
Compiled
Compiled
Compiled
Interpreted
Compiled
Compiled
Interpreted
Compiled

January Headline: Python is TIOBE's Programming Language of 2020!

....Python is popping up everywhere....Nowadays it is the favorite language in fields such as data science and machine learning, but it is also used for web development and back-end programming and growing into the mobile application domain and even in (larger) embedded systems. The main reasons for this massive adoption are the ease of learning the language and its high productivity. These two qualities are key in a world that is craving for more developers in all kinds of fields. Python already tested the second position some months ago and it will for sure swap places with Java permanently soon. Will Python also beat C? Well, C has still one trump card to play: its performance, and this will remain the case for some time to come.

January Headline: Python is TIOBE's Programming Language of 2020!

....Python is popping up everywhere....Nowadays it is the favorite language in fields such as data science and machine learning, but it is also used for web development and back-end programming and growing into the mobile application domain and even in (larger) embedded systems. The main reasons for this massive adoption are the ease of learning the language and its high productivity. These two qualities are key in a world that is craving for more developers in all kinds of fields. Python already tested the second position some months ago and it will for sure swap places with Java permanently soon. Will Python also beat C? Well, C has still one trump card to play: its performance, and this will remain the case for some time to come.

ten computer codes than transformed science

ten transformative codes

  • Fortran compiler (1957)
  • Fast Fourier transform (1965)
  • Biological databases (1965)
  • General circulation model of the climate (1969)
  • BLAS (1979)
  • NIH Image / ImageJ / Fiji (1987)
  • BLAST (1990)
  • arXiv (1991)
  • IPython Notebook / Jupyter (2011)
  • AlexNet (2012)

ten transformative codes

  • Fortran compiler (1957)
  • Fast Fourier transform (1965)
  • Biological databases (1965)
  • General circulation model of the climate (1969)
  • BLAS (1979)
  • NIH Image / ImageJ / Fiji (1987)
  • BLAST (1990)
  • arXiv (1991)
  • IPython Notebook / Jupyter (2011)
  • AlexNet (2012)

“For data scientists, Jupyter has emerged as a de facto standard,” Nature wrote in 2018. At the time, there were 2.5 million Jupyter notebooks on the GitHub code-sharing platform; today, there are nearly 10 million, including the ones that document the 2016 discovery of gravitational waves and the 2019 imaging of a black hole. “That we made a small contribution to those projects is extremely rewarding,” Pérez says.

Python in the Lab

Python in the Lab

Python in the Lab

Python in the Lab

Blender for modeling, animation, simulation, video editing

Python in the Lab

Python in the Lab

Python in the Lab

Because python is interpreted

To run our python programs, we need:

  • Our code (which can appear, e.g., inside .py file, a quarto .qmd document, or an .ipynb notebook)
  • ​A python "interpreter" (which is just a program, usually written in C, almost always called "python")
cd ~/icn2025
uv run python

setup the "right" python environment

run the python interpreter

cd ~/icn2025
code .

Our class folder has been "init"ialized by uv, and contains a (hidden) folder called .venv (virtual environment). VS Code should find this and use it.

Let's get to it!

  • Access to today's class materials here:
  • Clone to our class folder using link from GitHub
cd ~/icn2025
gh repo clone NEUR0680-Spring25/inclass250129-YOUR_GITHUB_USERID
code .
  • Start VS Code (from our class folder)
  • Add the new folder to our uv "workgroup"
uv init inclass250129(tab key!)
  • Install the VS Code "jupyter" extensions