官术网_书友最值得收藏!

More options than just the IPython/Jupyter Notebook

I want to make sure that you know there's more than one way to run Python code. Now, throughout this book, we'll be using the IPython/Jupyter Notebook format but in the real world, you're not going to be running your code as a notebook. You're going to be running it as a standalone Python script. So I just want to make sure you know how to do that and see how it works.

So let's go back to this first example that we ran in the book, just to illustrate the importance of whitespace. We can just select and copy that code out of the notebook format and paste it into a new file.

This can be done by clicking on the New button at the extreme left. So let's make a new file and paste it in and let's save this file and call it, test.py, where py is the usual extension that we give to Python scripts. Now, I can run this in a few different ways.

主站蜘蛛池模板: 右玉县| 金溪县| 岳池县| 泰来县| 普定县| 隆化县| 长兴县| 和龙市| 虎林市| 利辛县| 柘荣县| 广德县| 徐水县| 伊通| 蒙自县| 文登市| 阳泉市| 繁峙县| 朝阳县| 轮台县| 潜山县| 瓦房店市| 洛川县| 当阳市| 科技| 九龙县| 驻马店市| 驻马店市| 瑞金市| 百色市| 浑源县| 莱西市| 安塞县| 惠东县| 金塔县| 林西县| 鄂州市| 兴仁县| 山西省| 尚志市| 清水河县|