Bhai...humare village areas me khet ke bagal me hi basti hoti hai.....literally you can not create a hard barrier. You just have to be careful or if you have money you can use snake repellent.
That is why most people kill the snakes-- preemptive strike. Mere papa mana karte hai saanp marne ke liye toh hum pakad ke door chod aate hai