PCI BP101T • Unit 1 (Module 1 of 5)⏱ 8 Min ReadEnglish + हिन्दी

BP101T Unit 1 – Basics of Python Programming for Pharmaceutical Sciences

Origin of Python, core computing terminology, compilation vs interpretation, bytecode, PVM, and pharmaceutical applications.

01

What is Python Programming?

Python is a high-level, interpreted, general-purpose programming language. Its syntax emphasizes code readability and structure, allowing pharmaceutical calculations, posology formulas, and data scripts to be written clearly with minimal boilerplate.

Key Features of Python

  • High-Level Language: You write code in human-readable instructions. You do not need to manage low-level hardware memory or CPU registers.
  • Interpreted & Interactive: Python executes instructions line-by-line. This makes testing small equations and posology rules instant.
  • Dynamically Typed: You do not need to define data types in advance (e.g. no need to write int dose = 500;). Python automatically determines the data type at runtime.
  • Large Standard Library ("Batteries Included"): Comes with built-in modules for mathematics, statistics, and scientific calculations.
02

History & Origin of Python

Python was created by Dutch programmer Guido van Rossum in the late 1980s (around December 1989) at Centrum Wiskunde & Informatica (CWI) in the Netherlands. It was officially released to the public in February 1991.

Major Versions of Python

1. Python 1.0 (1991–1994): Introduced basic functional programming tools (lambda, map, filter) and exception handling.
2. Python 2.0 (2000): Introduced list comprehensions, garbage collection for memory cleanup, and Unicode support.
3. Python 3.0 (2008 – Present): Major modern upgrade that cleaned up syntax flaws (such as print() becoming a function). Python 3.12+ is the current standard used across universities and pharmaceutical labs.
03

Basic Computer & Programming Terminology

1. Programming Language

A programming language is a set of rules, words, and symbols used to instruct a computer to perform calculations and process data.

  • Low-Level (Machine Code): Binary numbers (0s and 1s) understood by hardware. Difficult for humans to write.
  • High-Level (Python): English-like language that humans easily read and write.

2. Translators: Compiler vs. Interpreter

Computers only understand binary electricity signals (0 and 1). A Translator converts human-written code into machine instructions.

⚡ Compiler (C, C++, Rust)

Scans the entire source code at once before running. Produces an executable file (.exe).

🔍 Interpreter (Python, JavaScript)

Translates and executes instructions line-by-line in real time. Stops immediately on the line with an error.

3. How Python Runs: Source Code ➔ Bytecode ➔ PVM

When you run a Python script, it goes through two quick steps internally:

  1. Compilation to Bytecode: Python first translates your .py code into an intermediate platform-independent format called Bytecode (.pyc).
  2. Execution by PVM: The Python Virtual Machine (PVM) reads the bytecode and executes it on your CPU.
04

Why is Python Used in Pharmacy?

In modern pharmacy colleges and pharma companies, Python is used for:

  • Pediatric Dosage Rules (Posology): Young’s rule, Dilling’s rule, and Clark’s rule calculated automatically without calculation errors.
  • Pharmacokinetic (PK/PD) Graphs: Plotting drug concentration vs. time curves, elimination half-life (t1/2), and Area Under the Curve (AUC).
  • Clinical Trial Datasets: Processing patient lab test data, tablet dissolution similarity (f1, f2 factors), and quality control reports.
Back to Python SyllabusNext: 2. Installing Python Step-by-Step