Heads up... You're reading this book for free, with parts of this chapter shown beyond this point astext.
You can unlock the rest of this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.
It’s not my place to force an IDE on you for Python development. However, if you’re actively looking for a Python editor for the Python related chapters — then we should have a little chat.
Good news: if you have a Mac, it automatically ships (at the time of writing) with Python version 2.7. This is the same version LLDB uses.
If, for some weird reason, you like to
rm random things in Terminal and you need to reinstall Python, you can download Python here: https://www.python.org/downloads/. Make sure to download the version of Python that matches the version packaged with LLDB. If you’re not sure which version to get, you can get the LLDB Python version through Terminal:
lldb (lldb) script import sys; print sys.version
Don’t worry about the final part of the version number. If you have 2.7.12 and LLDB quotes 2.7.10, that will work just fine.
Python text editors
A list of Python editors can be found here: https://wiki.python.org/moin/PythonEditors.
Working with the LLDB Python module
When working with Python, you’ll often import modules to execute code or classes within that module. When working with LLDB’s Python module, you’ll sometimes come across an
import lldb somewhere in the script, usually right at the top.