Getting sender address, python
The bitcoin protocol doesn't really support the concept of a transaction sender. 

All you can come up with is an address owned by someone who previously controlled the transaction's outputs, which however might not actually be the sender (e.g. for e-wallets) and who may not actually intend to receive anything there in the first place.

Take some time to see a sample implementation written in C# (GetTransactionSenderAddress()).