Python Basics 101 – Part III: How to Create a Python Script in iPython Notebook
Hopefully installation of iPython Notebook was successful. After installing and running the notebook, let’s create a project. After running iPython Notebook and navigating to the localhost server, let’s begin making a project.
1. Create a New Notebook
Click on the button that says “New Notebook” on the far right.
2. Writing and Executing a Program
Click on the section that says “Untitled1” (it may say Untitled0 for you). Rename the script “Hello iPython Notebook!” Next, in the area with the green rectangle around it, type the following script: print “Hello iPython Notebook!” Then, click the play button above the green box.
There! That’s how you run a Python script in iPython Notebook.
3. Downloading Your Script
iPython Notebook automatically saves the files as .ipynb. This is not very useful especially if you want to open the file into another IDE/Text Editor. So let’s download our beautiful script as .py file.
After you have downloaded the file, you can go to your downloads folder and there it will be.
Congratulations! You now know how to make Python scripts in iPython Notebook!
Leave a Comment