Beginners who want to create a programming environment on windows
First, enable WSL (Windows Subsystem for Linux). This is a service that runs an OS called Linux on Windows. Originally, it is difficult to build a programming environment in Windows compared to other OS such as MacOS and Linux, so I only have a Windows PC, but I want to program! For the time being, let's try it with the C language I learned at university! It was a level to fold at the stage of environment construction. On the other hand, Linux is an OS that makes it very easy to build a programming environment, but the task of putting Linux on a Windows PC is quite troublesome. Fortunately, Microsoft has a service called WSL, so let's use it. This service is unthinkable a long time ago.
The Control Panel can be opened by right-clicking the Windows icon at the bottom left and typing Control Panel in "Search" that appears.
Select "Programs and Features" from the menu in the control panel. Click Enable or Disable Windows Features on the right menu.
Find the Windows Subsystem for Linux in the window that opens and check it. Let's reboot once to enable WSL.
Get an app called Ubuntu from the Microsoft Store. This is an image of the OS running on WSL. There are Ubuntu, Ubutnu18.04, Ubuntu16.04, but let's choose Ubuntu18.04 here. There is not much difference. Please start after downloading. A black screen will be displayed and you will be asked to set a user name and password in English. Enter it. Also, get Windows Terminal. It is a preview version, but there is no particular problem. Also, download and install an editor called VS Code. https://code.visualstudio.com/
When Windows Terminal starts, open the settings in the menu bar.
If you open Setting here, VS Code should start up. On the upper side of the screen
setting.json
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}"
Set the value of "defaultProfile" (c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40) A guid of settings for Ubuntu that appears when you scroll down (c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40)
setting.json
{
"guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"hidden": false,
"name": "Ubuntu-18.04",
"source": "Windows.Terminal.Wsl"
}
Replace with and save by overwriting. Now, when you open Windows terminal, the Ubuntu terminal will open automatically.
Open an Ubuntu terminal and copy and paste the following command. You can paste to the terminal with shift + crtl + V. You will be asked for a password, so enter the password you entered when setting up Ubuntu for the first time.
ubuntu.update
sudo apt update
sudo apt upgrade
sudo apt install build-essential
It will take some time, but think of it as an Ubuntu update and wait.
Open VSCode and click File> Setting> Extension on the menu bar to open a menu where you can install the extension. Therefore, please install the following extensions. Japanese Language Pack for VS Code Remote - WSL
Open the Ubuntu terminal again and
openvscode
code .
Enter. Now you can run VS Code on Ubuntu. Also, extensions from VS Code opened in the terminal Python C/C++ Please put in. These extensions point out mistakes in the supported programming languages and add highlights that make your code easier to read. This completes the minimum environment construction.
Create a C language hello world file with VS Code and save it. This time, let's assume that you saved it to Desktop.
hello_world.c
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
}
Click Terminal> New Terminal in the VS Code menu and you should see a terminal screen at the bottom. To that terminal
move_dir
cd Desktop
gcc hello_world.c
./a.out
If you type, the terminal will move to the Desktop folder, compile the hello_world.c file, execute the output a.out file, and output Hello World! To the terminal. Congratulations! You now have a C language development environment. Create more and more programs, compile and run them.
5.2 Python For Python it's easier.
hello_world.py
print("Hello World!")
And also from the terminal
move_dir
cd Desktop
python hello_world.py
Just do. Congratulations! You now have a Python development environment! It's easy! If you want to write in Python, go to the terminal.
installmojule
sudo apt install python3-pip
pip3 install jupyter
pip3 install ipython
pip3 install numpy scipy matplotlib pandas scikit-learn flask
You can install the required modules at.
Of course, you can easily create not only C and Python but also other programming languages. From google search
Ubuntu (the programming language you want to use)
All you have to do is enter the command in the article found in the search in, and put the extension of that programming language in VS Code. Golang: https://github.com/golang/go/wiki/Ubuntu Rust : https://www.rust-lang.org/tools/install
Let's enjoy programming!