We systematically investigated the structural stability and electronic properties of silicene-like nanotubes by potassium atoms encapsulated using density functional theory. The calculations show that all the structures of KnSi8(n+1) (n=2-12) nanowires are stable, the structural stable is proportional to the lengths of the nanowires. Electronic population analysis shows that K atoms gain electrons and Si atoms lose electrons as a whole, some electrons transferred from Si to K atoms. Because the peaks of d levels in DOS are contribution from the 3d hybridization levels of K and Si atoms, the magnetic moments derived from the orbitals hybridization. Maybe these kinds of nanowires will play an important role in spintronics and nanoelectronics.