Agree with Medea, plus want to add that even if you were to be able to apply for a visa while here, you will definitely have to send in your passport to the consulate and will then need to pick up the visa in your home country - but you'd be unable to leave to go pick it up as you'd have no passport.
Other than that, here's some info on what you need to do; rules differ for courses of less than three months and courses of longer than 3 months
http://www.eda.admin.ch/eda/en/home/...aty/rustv.html It's from the Russia page (for some reason), but non-EU is non-EU, so it's safe to assume that the same rules apply.