A computational method for generating inflow turbulence is presented in this paper. The turbulent boundary layer flow computation was used for providing the inflow turbulence. To keep velocity profiles as those of the wind tunnel measurements, the computational method which Lund et. al. used for spatially-developing boundary layer simulations was applied. Though only time-averaged velocity profiles were prescribed, resulting fluctuating velocity profiles also show good accordance with experiments. Then flow computations around a three-dimensional square cylinder at the Reynolds number 24,000 are presented and the results are compared with experimental results. The computed results show better agreement with the experimental data and the method presented here is proved to be a convenient tool for generating inflow turbulence.