[해결방법] SyntaxError: Non-ASCII character

This topic contains 1 reply, has 2 voices, and was last updated by  cefm**** 2018-06-27 23:44.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #649

    technote
    Keymaster

    # python test.py
    File “test.py”, line 8
    SyntaxError: Non-ASCII character ‘\xec’ in file test.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

     

    비록 한글이긴하지만 주석인데 위와 같은 에러가 발생합니다.

    python은 한글로 주석을 못다나요?

    • This topic was modified 4 months, 2 weeks ago by  technote.

    #653

    cefm****
    Participant

    python에서도 주석을 달 수 있습니다.

    다만 character encoding 방식에 대한 인지 문제로 인해 코드 상단에 하기 코드를 넣어주면 됩니다.

     

    # -*- coding: utf-8 -*-

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.