A new method of preparing the pseudo-pure state of a spin system for quantum computation in liquid nuclear magnetic resonance (NMR) was put forward and demonstrated experimentally. Applying appropriately connected line-selective pulses simultaneously and a field gradient pulse techniques we acquired straightforwardly all pseudo-pure states for two qubits in a single experiment much efficiently. The signal intensity with the pseudo-pure state prepared in this way is the same as that of temporal averaging. Our method is suitable for the system with arbitrary numbers of qubits. As an example of application, a highly structured search algorithm----Hoggs algorithm was also performed on the pseudo-pure state $mid 00>$ prepared by our method.