  Let $\pi:X\to Y$ be a factor map, where $(X,T)$ and $(Y,S)$ are topological
dynamical systems. Let ${\bf a}=(a_1,a_2)\in {\Bbb R}^2$ with $a_1>0$ and
$a_2\geq 0$, and $f\in C(X)$. The ${\bf a}$-weighted topological pressure of
$f$, denoted by $P^{\bf a}(X, f)$, is defined by resembling the Hausdorff
dimension of subsets of self-affine carpets. We prove the following variational
principle: $$ P^{\bf a}(X,
f)=\sup\left\{a_1h_\mu(T)+a_2h_{\mu\circ\pi^{-1}}(S)+\int f \;d\mu\right\}, $$
where the supremum is taken over the $T$-invariant measures on $X$. It not only
generalizes the variational principle of classical topological pressure, but
also provides a topological extension of dimension theory of invariant sets and
measures on the torus under affine diagonal endomorphisms. A higher dimensional
version of the result is also established.
