๐Ÿ Programming/HTML, CSS

๐Ÿ Programming/HTML, CSS

Flask ์‹คํ–‰ ์˜ค๋ฅ˜ | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 0: invalid start byte ํ•ด๊ฒฐ๋ฒ•

๊ฐ„๋‹จํ•œ flask ๋ช…๋ น์„ ์•„๋ž˜์™€ ๊ฐ™์ด ์ž…๋ ฅํ•œ ํ›„ Pycharm์—์„œ ์‹คํ–‰์„ ์‹œ์ผฐ๋”๋‹ˆ from flask import Flask app = Flask(__name__) @app.route('/') def home(): return 'This is Home!' if __name__ == '__main__': app.run('0.0.0.0',port=5000,debug=True) ์•„๋ž˜์˜ ๋งจ ๋งˆ์ง€๋ง‰์ค„ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. ๊ตฌ๊ธ€์— ๊ฒ€์ƒ‰ํ•ด๋ณด๋‹ˆ open()ํ•จ์ˆ˜์˜ encoding ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ํ†ตํ•˜์—ฌ ์ธ์ฝ”๋”ฉ ๋ฐฉ์‹์„ 'euc-kr' ๋˜๋Š” 'cp949' ๋“ฑ์˜ ๋ฐฉ๋ฒ•์œผ๋กœ ์ง€์ •ํ•ด์ฃผ๋ฉด ํ•ด๊ฒฐ๋œ๋‹ค๊ณ  ํ•˜๋Š”๋ฐ ๋‚˜๋Š” ์•„๋ฌด๊ฒƒ๋„ ์—†๋Š” ๊ธฐ๋ณธ ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰์‹œํ‚ค๋ ค๋Š” ๊ฒƒ์ด๋‹ค ๋ณด๋‹ˆ ์–ด๋””์„œ ์ธ์ฝ”๋”ฉ ๋ฐฉ์‹์„ ๋ฐ”๊ฟ”์ฃผ์–ด์•ผ ํ• ์ง€ ๋ชจ๋ฅด๊ฒ ์–ด์„œ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์„ ์ฐพ์•„๋ดค๋‹ค. ..

Dhey
'๐Ÿ Programming/HTML, CSS' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก