Page 262 - Beginning Programming with Pyth - John Paul Mueller
P. 262

press Enter. You see some scanty (but useful) help information, as shown in Figure 11-17.
FIGURE 11-17: Try getting some help information about the attribute you want to know about.
Python isn't going to blow up if you try the attribute. Even if the Notebook does experience problems, you can always restart the kernel (or simply restart the environment as a whole). So, another way to check out a package is to simply try the attributes. For example, if you type BPPD_11_Packages.SayHello.__sizeof__() and press Enter, you see the size of the SayHello() function in bytes, as shown in Figure 11-18.
FIGURE 11-18: Using the attributes will help you get a better feel for how they work.
Unlike many other programming languages, Python also makes the source code for its native language libraries available. For example, when you look into the \Python36\Lib directory, you see a listing of .py files that you can open in Notebook with no problem at all. Try uploading the os.py library that you use for various tasks in this chapter by using the Upload button on the Notebook dashboard. Make sure to click Upload next to the file after you’ve opened it; then click the resulting link, and you see the content shown in Figure 11-19. Note that .py files open in a simpler editor and don't display cells as the notebook files do that you’ve been using throughout the book.
       





























































































   260   261   262   263   264