This paper is concerned with numerical solutions to a singular stochastic control problem arising from the continuous-time portfolio selection with proportional transaction costs. The associated value function is governed by a variational inequality with gradient constraints. We propose a penalty method to deal with the gradient constraints and employ a finite difference discretization. Convergence analysis is presented. We also show that the standard penalty method can be applied in the case of a single risky asset where the problem can be reduced to a standard variational inequality. Numerical results are given to demonstrate the efficiency of the methods and to examine the behaviour of the optimal trading strategy.