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

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.

主站蜘蛛池模板: 德庆县| 大田县| 定州市| 宁海县| 莲花县| 盘山县| 崇州市| 当雄县| 克什克腾旗| 平泉县| 东平县| 广元市| 灵寿县| 赤壁市| 石嘴山市| 新郑市| 皮山县| 怀仁县| 中牟县| 屏东县| 宿迁市| 曲麻莱县| 舞阳县| 介休市| 资溪县| 蓝山县| 金湖县| 明溪县| 扶余县| 新兴县| 高碑店市| 偃师市| 多伦县| 平湖市| 万荣县| 津南区| 正宁县| 滦平县| 泽普县| 海丰县| 南开区|