Basics of python ①

Try running Python on Windows

What is a prompt?

A fixed symbol that is displayed to indicate that software etc. is "waiting for input". Originally, prompt is a word that refers to an action that encourages the other party to speak.

What is a python interpreter?

You can create and run small programs on the spot, and try out various functions of python.

Let's do it! !! !!

① When the command prompt starts, enter [python] and press the enter key. When ">>>" appears on the screen, the setting is complete! !! !!

ex) Enter 1 + 2 and press enter → 3 is displayed

② Exit the python interpreter. Press CTRL + Z, and when ^ Z is displayed on the screen, press enter to finish.

Enter letters and numbers

→ print ("character string") or print ('character string') "",'' Can be either → print (numerical value)

If SyntaxError: invalid character in identifier appears

It may be because you entered the program in double-byte characters → Turn off the Japanese input function and re-enter in half-width characters.

How to run a program saved in a file

① Open Notepad and enter the program. (2) Save as> Specify .py as the extension for the file name and save the file (this time test.py is used) ③ Start the command prompt ④ Enter python test.py and press the enter key.   If you want test.py to execute a file that is not the directory displayed on the command prompt screen, clarify the location of the file.

You can run the python program stored in the file by entering the "python file name".

Write a comment during the program

Comment

What is a style guide PEP8?

A thought-provoking guide for writing easy-to-read python programs

Check if the created program is compliant

① Install pycodestyle At the command prompt pip install pycodestyle → Successfully installed pycodestyle ~

② How to use pycodestyle pycodestyle filename

③ If a point to be corrected is found, it will be displayed.

Recommended Posts

Basics of Python ①
Basics of python ①
Basics of Python scraping basics
# 4 [python] Basics of functions
Basics of python: Output
Python basics ⑤
Python basics
Python basics ④
Python basics ③
Python basics
Python basics
Python basics
Python basics ③
Python basics ②
Python basics ②
python: Basics of using scikit-learn ①
Basics of Python × GIS (Part 1)
Paiza Python Primer 5: Basics of Dictionaries
Python basics: list
Introduction of Python
#Python basics (#matplotlib)
Python CGI basics
Python basics: dictionary
Getting Started with Python Basics of Python
Python slice basics
#Python basics (scope)
#Python basics (#Numpy 1/2)
Copy of python
#Python basics (#Numpy 2/2)
Review of the basics of Python (FizzBuzz)
#Python basics (functions)
Basics of Python x GIS (Part 2)
Python array basics
Python profiling basics
Python #Numpy basics
Python basics: functions
About the basics list of Python basics
#Python basics (class)
Python basics summary
Introduction of Python
Learn the basics of Python ① Beginners
Basics of binarized image processing with Python
Python: Basics of image recognition using CNN
[Learning memo] Basics of class by python
[Python3] Understand the basics of Beautiful Soup
I didn't know the basics of Python
The basics of running NoxPlayer in Python
[Basics of python basics] Why do __name__ == "__main__"
[Python] Chapter 02-04 Basics of Python Program (About Comments)
[Python] Chapter 02-03 Basics of Python programs (input / output)
[Introduction to Data Scientists] Basics of Python ♬
[Python3] Understand the basics of file operations
[Python] Operation of enumerate
List of python modules
Python basics ② for statement
Unification of Python environment
Copy of python preferences
Python basics 8 numpy test
[python] behavior of argmax
Usage of Python locals ()
the zen of Python