From the course: Build Three Real-World Python Applications

GitHub Codespaces

- [Instructor] We'll be using GitHub Codespaces throughout this course. GitHub Codespaces is a development environment that's hosted in the cloud. The way you can access Codespaces is through the GitHub repository that we have for this course. When you go to the repository, it'll look something like this, where you have the README down here, with some information, along with the different exercise files. You can look at the different exercise files here by clicking on the different folders. So, for example, with Chapter 1, you could see the different exercise files In here. There are two ways to navigate to Codespaces. If you were already in the GitHub repository, you can go to this Code button on the right and if you're currently on the Local tab make sure you switch to the Codespaces tab. And here, you can either create a new Codespace on the main, or if you have a current one running, you can click on that one. Another way you can navigate to Codespaces is by clicking the link below this video in the course. When you do that, you will go to this Codespaces page here. Again, either you may see Codespaces you've already been running, or you can create a new Codespace on main here. So if we create a Codespace on main, you click this and then it'll bring you to a loading page. Please note that the first time you load up a Codespace, it will take a little bit longer than future times. Now that our GitHub Codespace has loaded you could see the layout of it. I highly recommend if you are using GitHub Codespaces throughout this course that you should use the same Codespace each time you go in to continue your work. This way it can save your work as you go versus if you create a new Codespace it will start you from scratch with your progress. Now that we are in GitHub Codespaces, you can see off to the left we have our menu. And again, this looks very similar to the repository we saw earlier. When it comes to navigating to the different files, you could simply open these different Chapter folders. So again, you'll see all the different files within here. You'll notice that there are files named as such. So for example, 01_05b corresponds to video one five in the course. You'll also notice that each file has b and an e version, b stands for beginning and e stands for ending. So whenever you go to watch a video, I highly recommend you use the beginning file first because this will allow you to follow along with me while coding. If you need the ending file for reference, you can look at it and it will have the solution to what we coded in the video. In order to get into a file, you can click on it once, or you can double-click it to make sure that it stays on this page. We will be using the Jupyter Notebook version of GitHub Codespaces, so this will look very similar to Jupyter Notebooks, as you have seen on other applications, but in this case, it is just simply on a GitHub Codespace. Like a Jupyter Notebook, it has the code and markdown split up into different cells, where again, you could type code in. So if you needed x = 9, you could click over here to run that. And then up here, you will want to select your Environment. So first, make sure you select Python Environments and then you select Python 3.10.4. Once you do this, it will be connecting to the kernel and it will run and execute your code, which you could see by this little check mark down here and to see how long it took to run. Something else to note as we are going throughout the course is you will notice that there are mainly Jupyter Notebook files in the folders, but there are a few other, extra files. For example, this text file will be created later on. If you scroll down to Chapter 2, you will see that there's an API_key_example.txt file. And for Chapter 3, you will see we have a great_expectations.txt file, a man_in_top_hat.jpeg and a sense_and_sensibility.txt file. So again, these files are needed in these folders to reference for these Jupyter Notebook files. If you are not using Codespaces, please make sure that you have these files in the corresponding folder with your Jupyter Notebook files. Another thing to point out for the course is sometimes when we show the output of the course, sometimes it may show backwards, where it's going bottom to top and other times it'll go top to bottom. So you may notice that I may scroll to the top, or bottom, correspondingly, to show you the output of different code. When you are done with your Codespace, the way you can close out of it is you can click on this Codespaces button on the very bottom left and then you can go up here and click Stop Current Codespace. So again, that will take you out of your Codespace and shut it down properly. You will see this page, that Codespace is stopped and that means that you are good to go. Once you have stopped your Codespace, you can go to the GitHub repository, or the method we showed earlier, to navigate to the Codespace you created. So if we click here on Code, we could see that we have Friendly Guide is the Codespace that we created one minute ago. So if we click on here, it'll take us to the Codespace that we had. Sometimes you may see that button show up where you need to restart the Codespace first, so you'll just click on that and it'll help you restart it. Once you go back into this Codespace, you'll see that it is loading everything and it is also loading the files that we had open prior. So when you open up your Codespace again, it'll save your progress from where you were the previous time. Now that you know how to use GitHub Codespaces, you can follow along with me in the course videos.

Contents