I am a radiological technologist and a medical physicist. I will leave a memorandum of the process of learning programming in the article. I hope it will be helpful to someone in the future.
I wanted to start programming vaguely as a skill, so the first thing I did was Progate. This is the influence that Horiemon recommended. After clearing all the tutorials in various languages, I decided to study Python mainly. It seems that it can be used for general purposes such as Web, application, data analysis, and the population seems to be large. The deciding factor was that machine learning was a hot research theme.
This time, I will talk about the first step to actually run Python on my PC.
To handle Python, you first need to prepare an environment to run Python on your own PC. (* I am a Mac user.)
It seems that you don't need an expensive PC (for the time being). I am grateful that the threshold is low that I can start programming with just one PC.
If you have a PC at hand, then install Python. However, it seems that Python is actually installed as standard on Mac. There is nothing that can be used without installing it, but it seems that the version is old, so I would like to install the latest version. (Version 2.7 (2 series) may be more appropriate depending on the process you want to do. Beginners think that it is okay to install version 3.7 (3 series) for the time being.)
Among the several ways to install Python, I used the classic Anaconda. In addition to Python itself, Anaconda also includes libraries that are often used in machine learning, so even beginners who are not familiar with it can start with just this.
Did you just say "Python greedy set"?
You can easily download Anaconda for free from the URL below. https://www.anaconda.com/distribution/
Follow the steps to download the Anaconda installer, Install Anaconda.
When the installation is complete, it will pass through your PATH and you should be ready to use it. (* Depending on the version of Mac OS, you may need to add your own PATH!)
Start the terminal from Finder and check the operation.
After launching the terminal, type the following and press Enter (execute the command).
python --version
"Python 3.7.4" is displayed.
next,
conda --version
"conda 4.7.11" is displayed. It's working fine.
More detailed Anaconda installation methods are shared by many friendly people online. Also, if you study how to use the terminal, you will not be in trouble later.
I will make my debut in Python. You can use standard software, so enter the following code in a suitable text editor and save it on your desktop as "hello.py". (I use a text editor called "Atom") ".py" is the extension of the Python file.
hello.py
print("Hello")
Next, try running the Python file. Use the terminal to run. To run the file, you need to change to the directory where the file resides on your terminal. In this case, I saved it on the desktop, so I can run it by moving it to the desktop. If you saved the file in a folder, you need to move it to that folder. When you start the terminal, it starts from the state where you are in your home directory. Your desktop is usually directly under your home directory, so you should be able to go to your desktop by running the following command:
cd desktop
If you want to move to a folder called "Test" on your desktop
cd desktop/Test
You can move with. If you want to go back to the previous directory (parent directory),
cd ..
You can go back with. Don't forget the space after "cd". If you can move to the directory correctly, there is only execution. Run the following command:
Python hello.py
If "Hello" is displayed on the terminal, it is successful. You can run a Python file by typing "Python file name" and pressing Enter. I was able to build an environment to run Python on my PC safely.
Recommended Posts