Recently, the development of photoelectron velocity map imaging makes it much easier to obtain the photoelectron angular distributions (PADs) experimentally. However, explanations of PADs are only qualitative in most cases, and very limited works have been reported on how to calculate PAD of anions. In the present work, we report a method using the density-functional-theory Kohn-Sham orbitals to calculate the photodetachment cross sections and the anisotropy parameter β. The spherical average over all random molecular orientation is calculated analytically. A program which can handle both the Gaussian type orbital and the Slater type orbital has been coded. The testing calculations on Li(-), C(-), O(-), F(-), CH(-), OH(-), NH2 (-), O2 (-), and S2 (-) show that our method is an efficient way to calculate the photodetachment cross section and anisotropy parameter β for anions, thus promising for large systems.