Python/Python Crash Course

Python Crash Course: 챕터 1

1june 2024. 6. 19. 16:05

Python Crash Course, 3rd Edition

 

  • Python Installation / 설치
 

Welcome to Python.org

The official home of the Python Programming Language

www.python.org

 

  • VS Code Installation / 설치
 

Visual Studio Code - Code Editing. Redefined

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.

code.visualstudio.com

 

 

    • Running Python in a Terminal Session / 윈도우 터미널로 파이썬 인터프리터 실행
PS C:\Users\ANITA> python
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun  6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Type python in lowecase letter / 소문자로 python 입력 후 

If (>>>) python prompt is identified / (>>>) 파이썬 프롬프트 식별되면

Python interpreter is successfully running on terminal / 실행 성공 

>>> print("Hello Python interpreter!")
Hello Python interpreter!

 

  • Running a Hello World Program on VS Code / VS Code 이용해서 코드 조각 테스트

print("Hello Python world!")

Press CTRL-F5 to run without debugging / 컨트롤키-F5 눌러서 디버깅 없이 코드 실행

PS C:\Users\ANITA\Desktop\python_work> ^C
PS C:\Users\ANITA\Desktop\python_work>
PS C:\Users\ANITA\Desktop\python_work>  c:; cd 'c:\Users\ANITA\Desktop\python_work'; & 'c:\Users\ANITA\AppData\Local\Programs\Python\Python312\python.exe' 'c:\Users\ANITA\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '12795' '--' 'c:\Users\ANITA\Desktop\python_work\hello_world.py'
Hello Python world!

 

  • Running Python program from Terminal / 윈도우 터미널로 파이썬 프로그 실행
PS C:\Users\ANITA> cd Desktop\python_work
PS C:\Users\ANITA\Desktop\python_work> dir


    디렉터리: C:\Users\ANITA\Desktop\python_work


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----  2024-06-19(수)   오후 7:55            139 hello_world.py


PS C:\Users\ANITA\Desktop\python_work> python hello_world.py
Hello Python world!
Hello Python world!
Hello Python Crash Course world!
PS C:\Users\ANITA\Desktop\python_work>