Logic circuit simulator in python