MCP23017 Raspberry Pi Python Coding

Hello. Inexperienced user here so please forgive my ignorance. I was not able to find a post similar to this but if I am repeating a previously answered question, my apologies in advance.

I have an mcp23017 connected to a Raspberry Pi using an I2c and developing in Python. I am looking to use the relays as outputs and hoping to get some sample code for how to turn on the relays individually. I have tried in both smbus and evdev and an currently trying to use evdev.

I2c communication has been enabled on our Raspberry Pi and my scan results are:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: 20 – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: 60 – – – – – – – – – – – – – – –
70: – – – – – – – –

If anyone has any sample code that could help out here I would really appreciate it.

hi,
i will recommend this script

here is one more lib

Thanks

Thank you very much for such a swift reply. I will take a look and hopefully can get this working now.

Again, thank you.