you could try downloading & installing a fresh copy of b160 firmware. there is something amiss in the current install/package. you can spend many hours trying to find the problem or get a new copy of the firmware and see if that works.
Like Vinicius said, if you have no real reason to use something like C and can get away with python, if it is not crucial to have a fast initialization time, I would go with Python. Also, the difference between python 2 and 3 is minimal. Really 3 is just making things a little more consistent. Mostly if you change your print "ok" to print("ok") that should do it. I would go with python 2.
One suggestion. I have found that it is faster to use os.system() for some things rather than their python equivalents. Perhaps you could look into that?