Python program that runs based on iPhone?

I want to write a program that makes my phone shut down/sound an alarm/anything when I plug it into my computer or anything else with a USB port. If not python it doesn't really matter, I know java and c++ also.

Iphone Is apple based so to write a program on your phone you will either need to jailbreak it or just learn C or Objective C

  • Which of these ruby and python should I use? I had had been concerning which of these I use. and I decided ruby. but I'm really not sure which I should use. things I wanna do: Raspberry Pi, create web app, Android app, iphone app, and I'm into Machine learning, computer network, security and math. currently I'm good at java. so which of these would be better for me to choose. Let me know the reason too!
  • Should I learn objective-c or python? I'm just getting into computer programming. I have a macbook pro for my main computer and I was wanting to be able to make an A. I. (for an end project) but I'm not sure if I wanna use objective-c or python. I already know a little bit of python. But not enough to make it. I would like to to be ran on both windows and mac. But I also want to make an iphone app with it.
  • My iphone battery runs out very quick? I only had it for less then a year and my iphones battery runs out very quickly. And it sometimes won charge it too 100 just to 98 and i leave my phone in my locker at school and i don't use it but when i come back it drops all the way to 70 or 56 and once it gets to 80 it just drops very fast. I tried doing the battery save thing and i don't know
  • My iPhone 5 battery runs out really quickly? I just got my iPhone for Christmas and the battery is terrible. It is fast and does everything fine but the battery lasts like 2 hours. I have turned my brightness down and Bluetooth off etc and the battery is still bad. It drained 30% today in about 20 mins and it also takes about 30 mins to charge. Is there anything I can do or is there a problem with my phone.