I am using python code to transmit data collected (Wii Nunchuck) via I2C wirelessly to another wireless node and then display the information about button press and also roll, yaw and pitch (X,Y,Z) data. The code uses Wx python for frame/window display. Part of the code was copied from the company that sells the wireless devices.

[self.panel.text.SetLabel('%d' % xdata)]

The code above displays the data (xdata) in a window. My question has to do with the % (percent) symbol. I have seen it used to mod data but I cannot find a reference as to how the label '%d' and % functions.

Can someone explain what the % key means or its function as i cannot find its usage in any python manual.

Thanks

Recommended Answers

All 2 Replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.