Skip to content

Tutorial 3

zwj2 edited this page Nov 17, 2022 · 1 revision

Navigating with IDE

Jupyter notebook

You can open jupyter notebook easily by inputting the command line jupyter notebook in your cmd, it will take you to a website if you look it carefully you will find it do is your user catalog. And then you need to create a folder to save some python files you write. Yes, if you want to create a python file, you need to choose a “house” first, in jupyter notebook it calls kernel. Just click the button new and then choose the kernel.

Write your code

After creating a python file, you can write your code in the cell, yes, there are many cells to let you edit code or notes, and most important is that allows you interactive programming. You can press Ctrl+Enter to run the cell’s code.

Edit mode

You need to notice the color of the cell, it has two different colors: green and blue, green means the cell in edit mode you can write your code or take notes, another color tells you that the cell is in command mode. Similarly, you can do many things under the command mode, such as: press key A, you will create a new cell in the above of this old cell, press key B means below, and press key H, means help.

Pycharm

When you open pycharm first time, you need to create a new project and choose a location to save it, in the same time, you create a new virtual environment automatically. You know, we always need in a certain environment to run our code. Yes, you can also choose the ‘house’ built by anaconda just like my_pymatgen we mentioned before.

Write your code

After you create a new project successfully that means you have configured the environment. And then you need to create a new python file or folder in this project. You can make it by click file and new to create a new python file for writing your code. Then press Ctrl+Shift+F10 to run your code.

Congratulations, you have learned the basic usage of IDE. Now you can move to Tutorial 4 learning some basic knowledge of python.

Clone this wiki locally