1. 인스타그램 클론 작동시키기 1) backend 마지막 강의까지 완료된 코드 frontend: backend에서 static: 프론트앤드 파트 예제파일 업로드 다운로드 받았습니다. backend: 마지막까지 완성된 수정 코드 어디서 받을 수 있는지 알고 싶습니다. 2) backend 마지막 강의까지 완료된 코드로 배포해서 구현하기 제로베이스 기준에서 어떤어떤 강의를 듣고 환경을 설정해야 마지막 배포까지 할 수 있는지 알려주시면 직접 배포해서 환경에서 돌아가는 것 까지 스스로 해보고 싶습니다. 2. 제주도 카페 클론 작동시키기 기초 :: Django 에서 기초 전체 소스코드 다운 받았습니다. 마찬가지로 어떤어떤 강의를 보고 최소한의 세팅을 해야 배포까지 해서 작동하는지 알고 싶습니다. 30분 요약시리즈부터 맨앞부터 하는데 frontend가 끝나니까 벌써 조금 지쳐서 힘들어서 보고 싶어지네요.. 감사합니다~~
dlib을 설치하는데 계속 이런 에러가 떠서 찾아보고 해봤는데 계속 안되는데 왜 그런지 알려주실 수 있을까요.. (ComputerVision) usang-in-ui-MacBook-Pro:~ usang-in$ pip3 install dlib Collecting dlib Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz Building wheels for collected packages: dlib Running setup.py bdist_wheel for dlib ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-wheel-ecxo61rx --python-tag cp36: running bdist_wheel running build running build_py package init file 'dlib/__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14) Invoking CMake setup: 'cmake /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/lib.macosx-10.9-x86_64-3.6 -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -DCMAKE_BUILD_TYPE=Release' -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/temp.macosx-10.9-x86_64-3.6/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_475b6/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project) -- Configuring incomplete, errors occurred! See also "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/temp.macosx-10.9-x86_64-3.6/CMakeFiles/CMakeOutput.log". See also "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/temp.macosx-10.9-x86_64-3.6/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py", line 261, in <module> 'Topic :: Software Development', File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup return distutils.core.setup(**attrs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run self.run_command('build') File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py", line 135, in run self.build_extension(ext) File "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py", line 172, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/lib.macosx-10.9-x86_64-3.6', '-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1. ---------------------------------------- Failed building wheel for dlib Running setup.py clean for dlib Failed to build dlib Installing collected packages: dlib Running setup.py install for dlib ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-record-m5vnrry6/install-record.txt --single-version-externally-managed --compile: running install running build running build_py package init file 'dlib/__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14) Invoking CMake setup: 'cmake /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/lib.macosx-10.9-x86_64-3.6 -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -DCMAKE_BUILD_TYPE=Release' -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/temp.macosx-10.9-x86_64-3.6/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_0561c/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project) -- Configuring incomplete, errors occurred! See also "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/temp.macosx-10.9-x86_64-3.6/CMakeFiles/CMakeOutput.log". See also "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/temp.macosx-10.9-x86_64-3.6/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py", line 261, in <module> 'Topic :: Software Development', File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup return distutils.core.setup(**attrs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 545, in run self.run_command('build') File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py", line 135, in run self.build_extension(ext) File "/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py", line 172, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/build/lib.macosx-10.9-x86_64-3.6', '-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1. ---------------------------------------- Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-record-m5vnrry6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_2/f0m32tsj68sf2fx0l4nhmh7w0000gn/T/pip-install-trs12u8b/dlib/ You are using pip version 10.0.1, however version 20.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
sum = 0 for v in range(1,101): sum += v # sum1 = sum1 + v print(sum) print() print('1 ~ 1000 Sum : ', sum(range(1, 1001))) 위경우에 마지막 print 문에서 에러가 발생합니다. sum 변수가 먼저 0 으로 선언됐기 때문에 마지막줄의 print 문속에 sum 함수에서 에러가 나던데요? 먼저 sum 이 변수 선언되면 되었기때문에 뒤에 sum(range(1,1001) 처럼 sum 함수를 사용할 수 없는 건가요?
마지막 강좌를 실습하는 과정에서 import winsound 구문을 입력하고 실행하면 아래와 같은 메시지가 나옵니다. ModuleNotFoundError: No module named 'winsound' 맥에서는 어떻게 처리해야 되는지 궁금하며, 만약 향후에 이와 같은 사운드를 OS와 상관없이 재생하도록 하려면 어떤 모듈을 활용해야하는지도 궁금합니다.
문제를 다른 방법으로 풀면 풀리기는 하는데, 이 방법이 어떻게 잘못됐는지 잘 모르겠습니다. import sys sys.stdin = open ( "input.txt" , "rt" ) #sys.stdin = open("input.txt", "rt") arr_ = [ list ( map ( int , input ().split())) for _ in range ( 9 )] brr = [] flag = "YES" dx = [- 1 , 0 , 1 , 0 ] dy = [ 0 , 1 , 0 , - 1 ] ################ 행 , 열 검사하는 내용 ################## for i in range ( 9 ): brr.clear() for j in range ( 9 ): brr.append(arr_[i][j]) if len ( set (brr)) != 9 : flag = "NO" break ################################################# ################## 3x3 검사하는 내용 ##################### if flag == "NO" : print (flag) else : for i in range ( 0 , 7 , 3 ): brr.clear() for j in range ( 0 , 7 , 3 ): ########### 문제의 코드 ############ brr.append(arr_[i][j]) brr.append(arr_[i][j + k*dy[ 1 ]] for k in range ( 1 , 3 )) # 우측 brr.append(arr_[i + dx[ 2 ]][j]) # 다음줄 시작점 brr.append(arr_[i + dx[ 2 ]][j + k*dy[ 1 ]] for k in range ( 1 , 3 )) # 우측 brr.append(arr_[i + 2 *dx[ 2 ]][j]) # 다음줄 시작점 brr.append(arr_[i + 2 *dx[ 2 ]][j + k*dy[ 1 ]] for k in range ( 1 , 3 )) # 우측 ########### 문제의 코드 ############ if len ( set (brr)) != 9 : flag = "NO" print (flag) break if flag == "YES" : print (flag) 제가 생각했던건 arr_ 을 스도쿠 맵이라고 하고 각 행과 열, 3x3 리스트의 숫자들을 각각 brr이라는 리스트에 추가해서 마지막에 brr을 set으로 중복 없앤 뒤, 길이가 9가 아니라면 no라고 하였습니다. 그런데 ##문제의 코드## 에서 옳지 않은 값이 들어가는 것 같습니다. (이 부분은 3x3 리스트의 값을 체크하는 식입니다) 저는 처음에 3x3 안의 값들을 brr에 추가하기 위해서 brr.append를 하고 안에다 arr[i][j]의 원소 값들을 넣으려고 했습니다. 그런데 디버깅을 해보니까 원소의 값들에 접근할 때, dx와 k * dy + for 문에서 이상한 값이 들어가는 것 같습니다. 왜 이상한 값이 들어가는지 알 수 있을까요?
첫 실습 문제 2번의 코드를 보면 (k번째 작은 수 찾기) import sys sys.stdin= open ( "input.txt" , "rt" ) x = int ( input ()) for i in range (x): n , s , e , k = map ( int , input ().split()) ins = list ( map ( int , input ().split())) ins = ins[s- 1 :e] ins.sort() print ( "#%d %d" %(i+ 1 , ins[k- 1 ])) 이와 같은데, 마지막 print문을 보면 for문이 끝날때마다 출력이 한번씩 되어야하는거 아닌가요? 이게 파일로 입력을 받아서 프린트가 다 끝나고 한번에 나오는건지, 혹시 그렇다면 만약 파일로 입력을 받지 않고 직접 콘솔에 타이핑해서 입력하면 for문에서 입력할때마다 출력문이 바로 나오는건지 궁금합니다. (강의를 보면 위와 같은 코드로 실행시키고, input 텍스트 파일에 값을 넣었을때, 정답이 #1 #2가 한번에 출력이 됩니다.)
[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
안녕하세요. 끝까지 수강하기위해 노력중인 수강생이에요.. 마지막갈수록 어려워지는건 기분탓일까요.. Open API를 사용해서 랭킹, 제목, 링크까지 뽑아내는건 성공했습니다. 그런데 동영상 13분 30초에서도 보면 title로 뽑아낸 자료들에 전부 <b> </b> 태그가 붙는데 이 태그를 없애는 방법이 따로 있나요? 전에 썼던것 처럼 get_text 이런걸 써주면 해결되는 부분인가요? 제가 나름대로 get_text 를 써서 리스트 안에 넣어봤는데 안되더라구요. 어찌해야할까요?
[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
이게 제가 현재 쳐놓은 코드입니다. 네이버 자체의 코드가 살짝 바뀌어서 그대로 적용을 했는데, 나오지가 않더라구요. 이거 하기전에 bs4, requests 모듈은 설치를 완료한 상태고, 다음 크롤링에서는 잘 됐는데, 왜 여기서는 안되는건지 제가 잘못한 부분이 있나 한번 봐주시겠어요? 되다가 갑자기 안되니까 뭐가 잘못된지 잘 모르겠어서 당황스럽네요.