Using Cursor In Python If You Executed