Programming/Python

파이썬이란 / What is Python

옥뀨 2021. 1. 15. 18:40

파이썬이란?

What is Python?

 

 

파이썬은 1990년 암스테르담의 귀도 반 로섬이 개발한 인터프리터 언어이다.

Python is an interpreter language developed by Guido van Rossum in Amsterdam in 1990.

 

인터프리터 언어란 컴파일러를 거치지 않고 소스 코드를 바로바로 실행하는 프로그래밍 언어이다.

The interpreter language is a programming language that directly executes source code

without going through a compiler.

 

컴파일러의 과정을 거쳐 실행되는 대표적인 언어에는 C 언어가 있다.

C language is a representative language that executes a program through the process of a compiler.

 

컴파일된 프로그램들은 인터프리터를 이용해 실행시키는 것보다 더 빠르게 실행된다는 장점이 있지만

원시 프로그램의 크기가 크다면 상당한 시간이 걸릴 수 있다.

Compiled programs have the advantage of running faster than running them using an interpreter,

but if the size of the source program is large, it can take a long time.

 

이에 반해 인터프리터 언어로는 고급 프로그램을 즉시 실행시킬 수 있다는 장점과

한 번에 적은 양의 내용을 추가하고 그것을 빠르게 테스트가 가능하다는 장점이 있다.

On the other hand, the interpreter language has the advantage of being able to execute a high-level program immediately, and the advantage of being able to quickly test it by adding a small amount of content at once.

 

파이썬은 실무에서도 굉장히 많이 쓰이는 언어이며 대표적인 예로 구글의 인스타그램과 드롭박스가 있다.

Python is a very popular language in practice, and representative examples are Google's Instagram and Dropbox.

 

 

파이썬의 특징

Features of Python

 

- 파이썬은 문법이 쉽고 간결하여 쉽고 빠르게 배울 수 있는 언어이다.

- Python is a language that can be learned quickly and easily due to its simple and concise syntax.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
#incldue <stdio.h>
int main()
{
    int a[] = {1234};
    int i;
    int j = sizeof(a);
    for(i=0; i<j; i++)
    {
        if(a[i] == 4)
            printf("4가 있습니다.\n");
    }
    return 0;
}

 

1
if 4 in [1,2,3,4]: print("4가 있습니다.")

 

위의 코드는 배열에서 4가 있다면 4가 있다는 내용을 출력하는 C 언어 소스 코드이고 아래 코드는

파이썬에서 리스트 자료형에 4가 있다면 4가 있다는 내용을 출력하라는 소스코드이다.

The code above is written in C language, and the code below is written in Python language.

 

같은 결과를 출력하는 프로그램으로도 파이썬 코드로 쉽고 간결하게 표현 할 수 있다.

Even though it is a program that outputs the same result,

it can be expressed easily and concisely with Python code.

 

- 파이썬은 무료이고 강력한 언어이다.

- Python is a free and powerful language.

 

$ ./attackme $(python -c 'print "A"*268 + "\xe1\xf2\xff\xbf"')

 

위 코드는 버퍼오버플로우를 일으키는 구문이다.

The above code is the statement that causes the buffer overflow.

 

지금 이 포스팅에서 깊게 들어가진 못하지만 파이썬 코드로 A를 268 만큼 대입시켜

해당하는 메모리에 부하를 일으켜 장애를 일으킨다.

I can't go deeper in this post right now, but I put 268 "A"s in the program that will cause the failure

with Python code, causing a load on the memory and causing the failure.

 

짧은 문장만으로도 장애를 일으킬 수 있고 짧은 문장으로 프로그램을 동작하게 하는

파이썬은 강력한 언어이다.

Python is a powerful language that can cause obstacles with just short sentences

and can create programs with short sentences.

 

간단하게 파이썬에 대해 알아봤으니 다음 포스팅부터는 파이썬으로 코딩하는 것을 올려보도록

하겠다.

Now that we have briefly learned about Python, I will post coding in Python from the next post.