Algorithms For Dummies. John Paul Mueller

Читать онлайн.
Название Algorithms For Dummies
Автор произведения John Paul Mueller
Жанр Программы
Серия
Издательство Программы
Год выпуска 0
isbn 9781119870005



Скачать книгу

Colab IDE.

      Customizing keyboard shortcuts

       To add or change a shortcut, place the cursor in the box next to the command and press the shortcut key you want to use for that command.

       To remove a shortcut, press Delete.

Snapshot shows Customize shortcut keys for speed of access to commands.

      Comparing files

Snapshot shows Colab lets you compare two files to see how they differ.

      The notebook forms the basis for interactions with Colab. In fact, Colab is built on notebooks, as previously mentioned. When you place the mouse on certain parts of the Welcome page at https://colab.research.google.com/notebooks/welcome.ipynb, you see opportunities for interacting with the page by adding either code or text entries (which you can use for notes as needed). These entries are active, so you can interact with them. You can also move cells around and copy the resulting material to your Google Drive. Of course, although interacting with the Welcome page is both unexpected and fun, the real purpose of this chapter is to demonstrate how to interact with Colab notebooks. The following sections describe how to perform basic notebook-related tasks with Colab.

      Creating a new notebook

Snapshot shows Create a new Python 3 Notebook.

      FIGURE 3-5: Create a new Python 3 Notebook.

      The notebook shown in Figure 3-5 lets you change the filename by clicking it. To run the code in a particular cell, you click the right-pointing arrow on the left side of that cell. After you run the code, you must choose the next cell directly.

      Opening existing notebooks

Snapshot shows the dialog box to open existing notebooks.

      FIGURE 3-6: Use this dialog box to open existing notebooks.

      The default view shows all the files you opened recently, regardless of location. The files appear in alphabetical order. You can filter the number of items displayed by typing a string into the Filter Notebooks field. Across the top are other options for opening notebooks.

      

Even if you’re not logged in, you can still access the Colab example projects. These projects help you understand Colab but won’t allow you to do anything with your own projects. Even so, you can still experiment with Colab without logging into Google first. The following sections tell you more details about these options.

      Using Google Drive for existing notebooks

      Google Drive is the default location for many operations in Colab, and you can always choose it as a destination. When working with Google Drive, you see a list of files similar to those shown in Figure 3-6. To open a particular file, you click its link in the dialog box. The file opens in the current tab of your browser.

      Using GitHub for existing notebooks

Snapshot shows when using GitHub, you must provide the location of the source code.

      FIGURE 3-7: When using GitHub, you must provide the location of the source code.

      Using local storage for existing notebooks

      If you want to use the downloadable source for this book, or any local source for that matter, you select the Upload tab of the dialog box. In the center is a single button, Choose File. Clicking this button opens the File Open dialog box for your browser. You locate the file you want to upload, just as you normally would for opening any file.

      

Selecting a file and clicking Open uploads the file to Google Drive. If you make changes to the file, those changes appear on Google Drive, not on your local drive. Depending on your browser, you usually see a new window open with the code loaded. However, you could also simply see a success message, in which case you must now open the file using the same technique as you would when using Google Drive. In some cases, your browser asks whether you want to leave the current page. You should tell the browser to do so.

The File ⇒ Upload Notebook command also uploads a file to Google Drive. In fact, uploading a notebook works like uploading any other kind of file, and you see the same dialog box. If you want to upload other kinds of files, using the File ⇒ Upload Notebook command is likely faster.

      Saving notebooks