cheon20040752
@cheon20040752
Reviews Written
4
Average Rating
5.0
Posts
Q&A
์๋ฌ๋ฌธ์
์์ธํ ์ฐพ์๋ณด๋ ์คํ๊ฐ ์์๋ค์.์์ ํ๋๊น ์ ์์๋ ๋๋๊ฑฐ ํ์ธํ์์ต๋๋ค.
- 1
- 3
- 1K
Q&A
์๋ฌ๋ฌธ์
login_required ์ง์ฐ๊ณ ํ๋๋ฐ๋ ๋๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค์.. 6๋ถ44์ด ์ ๊น์ง๋ ๋ค ์ ๋์๋๋ฐ.. ๋ค๋ฅธ ๋ฐ์ ๋ก๊ทธ์ธ์ฒดํฌ๊ธฐ๋ฅ๋ ์ ์๋ํ๋๋ฐ.. @blueprint.route("/comment_write", methods=["POST"]) def comment_write(): if request.method == "POST": name = session.get("name") writer_id = session.get("id") root_idx = request.form.get("rood_idx") comment = request.form.get("comment") current_utc_time = round(datetime.utcnow().timestamp() * 1000) c_comment = mongo.db.comment post = { "root_idx": str(root_idx), "writer_id": writer_id, "name": name, "comment": comment, "pubdate": current_utc_time } c_comment.insert_one(post) return redirect(url_for("board.board_view", idx=root_idx))BuildErrorwerkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'board.board_view'. Did you forget to specify values ['idx']?Traceback (most recent call last)File "c:\Python\myweb\venv\lib\site-packages\flask\app.py", line 2091, in __call__return self.wsgi_app(environ, start_response)File "c:\Python\myweb\venv\lib\site-packages\flask\app.py", line 2076, in wsgi_appresponse = self.handle_exception(e)File "c:\Python\myweb\venv\lib\site-packages\flask\app.py", line 2073, in wsgi_appresponse = self.full_dispatch_request()File "c:\Python\myweb\venv\lib\site-packages\flask\app.py", line 1519, in full_dispatch_requestrv = self.handle_user_exception(e)File "c:\Python\myweb\venv\lib\site-packages\flask\app.py", line 1517, in full_dispatch_requestrv = self.dispatch_request()File "c:\Python\myweb\venv\lib\site-packages\flask\app.py", line 1503, in dispatch_requestreturn self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)File "c:\Python\myweb\main\board.py", line 39, in comment_writereturn redirect(url_for("board.board_view", idx=root_idx))File "c:\Python\myweb\venv\lib\site-packages\flask\helpers.py", line 336, in url_forreturn appctx.app.handle_url_build_error(error, endpoint, values)File "c:\Python\myweb\venv\lib\site-packages\flask\helpers.py", line 323, in url_forrv = url_adapter.build(File "c:\Python\myweb\venv\lib\site-packages\werkzeug\routing\map.py", line 917, in buildraise BuildError(endpoint, values, method, self)werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'board.board_view'. Did you forget to specify values ['idx']?The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:dump() shows all variables in the framedump(obj) dumps all that's known about the object(์ฌ์ง)(์ฌ์ง)
- 1
- 3
- 1K
Q&A
ํ์ผ์ด๋ฆ ์ฒดํฌํ๋ ๋ถ๋ถ ์ง๋ฌธ๋๋ฆฝ๋๋ค.
๋ง์ง๋ง ์ง๋ฌธ์ ๋๋ค... ์๋์ฐ์์ ์คํํ์์ต๋๋ค. import re import os def check_filename(filename): reg = re.compile("[^A-Za-z0-9_.๊ฐ-ํ-]") for s in os.path.sep, os.path.altsep: if s: filename1 = filename.replace(s, ' ') print("filename => " + filename1) join = '_'.join(filename1.split()) print("join => " + join) sub = reg.sub('', join) print("sub => " + sub) strip1 = str(sub).strip("._") print("strip1 => " + strip1 ) filename = strip1 return filename print(check_filename("../../filename/.bash"))(์ฌ์ง)filename = strip1 ๊ฐ์ ๋ง์ง๋ง์ค์ ๋ฃ์ด์ ์ ์์ ์ผ๋ก ํ์ผ๋ค์์ด ๋์ค๋ ๊ฒ์ด ํ์ธ๋ฉ๋๋ค.์ฌ๊ธฐ์ ๊ถ๊ธํ์ ์ด ๊ฒฐ๊ณผ์ถ๋ ฅ 1๋ฒ์ ๋ณด๋ฉด ๊ทธ๊ฒ์filename.replace(s, ' ') ์ ๊ฒฐ๊ณผ๋ฌผ ๊ฐ์ ์๋ฏธํ๋๋ฐ ๊ทธ๊ฒ์ ์ฌ๋ฌ์๋ ์ญ์ฌ๋ฌ์ ๋ฌธ์๋ฅผ ๊ณต๋ฐฑ์ผ๋ก ๋ง๋ ๋ค๋ ์๋ฏธ์์์ ๊ทธ๋ฐ๋ฐ ๊ฒฐ๊ณผ์ถ๋ ฅ 1์ ๊ณต๋ฐฑ์ผ๋ก ๋์ค์ง ์์๊ฒ์ธ์ง ํ๋ ๋ถ๋ถ์ด์... ์ ์๊ฐ์ ๊ฒฐ๊ณผ์ถ๋ ฅ 1์ filename => .. .. filename .bash ์ด๋ ๊ฒ ๋์์ผ ํ ๊ฑฐ๊ฐ์๋ฐ ๋ง์ด์ฃ .. ๊ทธ๋ฆฌ๊ณ ๊ฒฐ๊ณผ์ถ๋ ฅ 2๋ฒ๋ ๊ณต๋ฐฑ์ _ ์ผ๋ก ๋ฌถ๋๋ค๋ ์๋ฏธ๋๊น join => .._.._filename_.bash ์ด๋ ๊ฒ ๋์์ผ ํ ๊ฑฐ ๊ฐ์๋ฐ ์ด๋ ๊ฒ ๋์ค์ง ์๋ค์..
- 1
- 5
- 497
Q&A
ํ์ผ์ด๋ฆ ์ฒดํฌํ๋ ๋ถ๋ถ ์ง๋ฌธ๋๋ฆฝ๋๋ค.
์๋์ฐ ์ด์์ฒด์ ์์ ์คํํ์์ต๋๋ค. import re import os def check_filename(filename): reg = re.compile("[^A-Za-z0-9_.๊ฐ-ํ-]") for s in os.path.sep, os.path.altsep: if s: filename1 = filename.replace(s, ' ') print("filename => " + filename1) join = '_'.join(filename1.split()) print("join => " + join) sub = reg.sub('', join) print("sub => " + sub) strip1 = str(sub).strip("._") print("strip1 => " + strip1 ) return filename print(check_filename("../../filename/.bash"))(์ฌ์ง)print("strip1 => " + strip1 ) ์ฝ๋ ์๋ซ์ค์ filename = strip1 ๋ฅผ ๋ฃ์ด์ค์ผ ์ ๋๋ก ์๋ํ๋๋ฐ์ ์ผ๋ถ๋ฌ ๊ทธ ๋ถ๋ถ ์ ์ธํ๊ณ ์คํ์์ผ ๋ณด์์ต๋๋ค. ๊ทธ๋ฌ๋ฉด strip1 ๊ฐ์ด filename_.bash ๋ก ๋์ต๋๋ค. ๊ทธ๋ค์์ filename = strip1 ๋ฅผ ๋ฃ์ด์ ์คํํ๋ฉด ์ ์์ ์ผ๋ก filename.bash ๋ก ๋์ต๋๋ค. ์ด์จ๋ ์ ๊ธฐ์ strip1 ๊ฐ์ filename_.bash์ ๋๋ค. ๊ทธ๋ฐ๋ฐ strip1 ์์ ๊ฐ์๊ธฐ ์ค๊ฐ์ ์๋ _ ๊ฐ ์ฌ๋ผ์ง๋์ง๊ฐ ๊ถ๊ธํ ๋ฐ๋ฆ์ ๋๋ค.
- 1
- 5
- 497
Q&A
ํ์ผ์ด๋ฆ ์ฒดํฌํ๋ ๋ถ๋ถ ์ง๋ฌธ๋๋ฆฝ๋๋ค.
์๋์ฐ์์ ์คํํ๊ณ filename.bash๋ก ์ ๋์ต๋๋ค.strip ํจ์๊ฐ ์ค๊ฐ์ _๋ฅผ ์ ๊ฑฐํ์ง๋ ๋ชปํ ํ ๋ฐ๋ฆฌํดํ๋ฉด ํฌํํ๊ฒ ์ ๊ฑฐ๊ฐ ์๋์ ์ผ๋ก ๋๋ค์
- 1
- 5
- 497
Q&A
์คํ์ค ์ค๋ธ์ ํธ ํ๋ง์ ๋ด๊ธด ์ค๋ธ์ ํธ๋ ์ด๋ป๊ฒ ๋ฐ๊พธ๋์?
๋ค๋ฅธ ์ค๋ธ์ ํธํ์ ์จ๋ณด๋๊ฑด ์ด๋ค๊ฐ์
- 0
- 1
- 238
Q&A
"IndexOutOfRangeException" ์๋ฌ๊ฐ ๋น๋๋ค...
์ ์ฌ ๋ง๋ฒ์ฌ ํ๊ธ๋์ ์๋ฌธ ์ํ๋ฒณ์ผ๋ก ํค๋ฅผ ๋ณ๊ฒฝํด์ ์คํ์์ผ๋ณด๋ฉด jj 1 1000 50 jj 2 1200 60 jj 3 1400 70 jj 4 1600 80 jj 5 1800 90 jj 6 2000 100 mm 1 500 200 mm 2 550 300 mm 3 600 400 mm 4 650 500 mm 5 700 600 mm 6 750 700 mm 7 800 800 mm 8 850 900 mm 9 900 1000 mm 10 950 1100 mm 11 1000 1200 mm 12 1050 1300 mm 13 1100 1400 mm 14 1150 1500 mm 15 1200 1600 KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at :0) DataManager.Start () (at Assets/DataManager.cs:29) ์ด๋ฐ ์๋ฌ๊ฐ ๋จ๋ค์ ์ด๊ฑฐ ์๊ทธ๋ฐ์ง ์์๋๋ถ ์ข ์๋ ค์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
- 0
- 2
- 925
Q&A
FormatException ์ค๋ฅ๋จ๋ค์
์๋๋ผ์ธ ๋๋ฌธ์ ์๋ฌ๊ฐ ๋๋๊ฒ ๋ง๋๊ฒ ๊ฐ๋ค์ txtํ์ผ ์์ ํ๋๊น ์์ธ์ฒ๋ฆฌ ๊ฒฝ๊ณ ์์ด ์ ์์ ์ผ๋ก ์ถ๋ ฅ๋จ์ ํ์ธํ์์ต๋๋ค. ๋ง์ง๋ง์ค ๋ผ์ธ 7๋ฒ์งธ์ค ์์ ๊ณ ์๋ก ๋ก๊ฒจ์ฃผ์ธ์(์ฌ์ง) (์ฌ์ง)
- 0
- 3
- 344
Q&A
๋ฒํผ scoretext์ scoreup ํจ์๊ฐ ์๋์ค๋๋ฐ
public void Scoreup (int number) void ์์ public ์ถ๊ฐํ์ธ์
- 0
- 1
- 321




