convert ipython to python