네이버웹툰 만화 -> 신혼일기 -> 15화 제목을 가져와 보려고 하기와 같이 코드를 작성했습니다만 주피터 노트북에서 run 했을 때 [ ] 라고만 나옵니다 ㅠㅠ 어떻게 해야 할까요?? import requests from bs4 import BeautifulSoup as bs url = " https://comic.naver.com/webtoon/list?titleId=812354 " rsp = requests.get(url, verify=False) rsp.raise_for_status() soup = bs(rsp.text, "lxml") print(soup.find_all("span", attrs={"class": "EpisodeListList__title--lfIzU"}))
안녕하세요. 강의 감사히 잘 듣고 있는 수강생입니다. 클로저 관련 내용을 듣다 궁금한 점이 있어 질문 드립니다. 해당 문제와 관련하여 다른 분들도 동일한 질문을 여러 번 올려주셨는데 "명확하게 이렇기 때문이다"라는 답변이 없이 외부 링크를 걸어주시거나 단답형으로 답변을 주셨던 것 같아 다시 질문을 드립니다. def closure_ex1(): # Free variable series = [] # 클로저 영역 def averager(v): # series = [] # 주석 해제 후 확인 series.append(v) print('inner >>> {} / {}'.format(series, len(series))) return sum(series) / len(series) return averager avg_closure1 = closure_ex1() # 잘못된 클로저 사용 def closure_ex2(): # Free variable cnt = 0 total = 0 def averager(v): cnt += 1 # cnt = cnt + 1 total += v return total / cnt return averager avg_closure2 = closure_ex2() 위 두 함수 closure_ex1과 closure_ex2를 비교하면 차이는 series는 list, cnt와 total은 int형 변수라는 것, averager 함수 내부에서 series는 append 작업을 하고, cnt와 total은 값을 더해주는 작업을 한다는 것 입니다. 그런데 closure_ex1에서는 오류가 나지 않고, closure_ex2에서는 averager 안에 nonlocal cnt, total을 작성하지 않으면 오류가 납니다. 여쭤보고 싶은 것은, [1] closure_ex1의 averager 함수 내부에 nonlocal series 라는 코드를 작성하지 않아도 되는 이유가 무엇 때문인가 입니다. closure_ex2의 averager 안에 nonlocal cnt, total 이 필요한 것은 내부 함수의 영역은 local 영역이고 closure_ex2 내부이면서 average 외부인 영역은 nonlocal 영역이기 때문에 local 영역에서 free variable을 write 작업하기 위해서는 nonlocal 변수 선언이 필요한 것으로 알고 있습니다. 하지만 series 변수에 대해서는 왜 nonlocal series 라는 코드가 필요하지 않은 것인지요? 제가 추가로 공부할 링크를 주시는 것은 감사하지만, 이 질문에 대한 답변을 명확하게 댓글로 작성해주시면 감사드리겠습니다. 다른 분들의 질문에 올려 주신 링크는 모두 읽어보았습니다. 또한 명확한 답변을 주시면 공부하시는 다른 분들께도 유용할 것이라고 생각합니다. 감사합니다. ps. 강의 영상을 확인하라는 답변도 주셨었는데, 수업에서 정확하게 list나 int형 자료의 scope 별 생명 주기까지 설명한 내용은 찾지 못하였으니 만약 해당 내용이 필요하다면 강의 시간을 알려주시면 감사드리겠습니다.
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
도서관 애플리케이션을 실행하는 도중 아래와 같은 긴 오류가 떴습니다. 검색을 해도 잘 모르겠습니다 ㅠ어떻게 해야 할까요? Error executing DDL "drop table if exists user cascade " via JDBC Statement Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "drop table if exists [*]user cascade "; expected "identifier"; SQL statement: Error executing DDL "create table user (id bigint generated by default as identity, age integer, name varchar(20) not null, primary key (id))" via JDBC Statement Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "create table [*]user (id bigint generated by default as identity, age integer, name varchar(20) not null, primary key (id))"; expected "identifier"; SQL statement: Error executing DDL "alter table if exists user_loan_history add constraint FKa17jbf1po26eytdyvyj73b4rw foreign key (user_id) references user" via JDBC Statement Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "alter table if exists user_loan_history add constraint FKa17jbf1po26eytdyvyj73b4rw foreign key (user_id) references [*]user"; expected "identifier"; SQL statement:
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.2.1' but: 현재 SDK는 11 Oracle, Language level은 11- local variable syntax for lambda parameters로 되어있습니다. 원래는 컴파일이 됐었는데 1번 강의(스프링 프로젝트를 시작하는 두 번째 방법) 이후 안되는 것 같습니다. 어떻게 해야할까요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요. 규제 부분 코드 실습 중 규제 클래스에 관해서 cross_val_score적용 시 NaN값이 반환되는 것이 확인되어 질문드립니다. 싸이킷런 버전의 경우 1.0.2버전인데 구글링을 했을 때는, 데이터 내에 NaN값이 있어서 그럴 것이라는데 제가 확인해봤을 때는 NaN값이 없었습니다. 혹시 버전과 관련된 문제일까요...? 동일 코드에 Ridge클래스대신 LinearRegression클래스로 대체시 정상적으로 코드가 동작하는 것을 확인하여 우선 Ridge클래스에 대한 문제로 간주하고 있습니다...ㅠ
OS: macOS python 3.10 버전을 사용하고 있고, sqlalchemy 2.0.19, pymysql 1.1.0 등등 최신 패키지 사용중입니다. from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker DATABASE_URL = "mysql+pymysql://root:todos@127.0.0.1/todos" engine = create_engine(DATABASE_URL, echo=True) SessionFactory = sessionmaker(autocommit=False, autoflush=False, bind=engine) connection.py 는 위와 같이 동일하게 작성했고, session.scalar(select(1)); 실행시 아래와 같은 오류가 발생하여 더 이상 진행을 할 수가 없습니다. Traceback (most recent call last): File "/Users/someone/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/232.8660.197/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode coro = func() File "<input>", line 1, in <module> File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2296, in scalar return self._execute_internal( File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2131, in _execute_internal conn = self._connection_for_bind(bind) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1998, in _connection_for_bind return trans._connection_for_bind(engine, execution_options) File "<string>", line 2, in _connection_for_bind File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go ret_value = fn(self, *arg, **kw) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1123, in _connection_for_bind conn = bind.connect() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3264, in connect return self._connection_cls(self) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 147, in __init__ Connection._handle_dbapi_exception_noconnection( File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2426, in _handle_dbapi_exception_noconnection raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 145, in __init__ self._dbapi_connection = engine.raw_connection() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3288, in raw_connection return self.pool.connect() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 452, in connect return _ConnectionFairy._checkout(self) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 1267, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 716, in checkout rec = pool._do_get() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 169, in _do_get with util.safe_reraise(): File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__ raise exc_value.with_traceback(exc_tb) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 167, in _do_get return self._create_connection() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 393, in _create_connection return _ConnectionRecord(self) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 678, in __init__ self.__connect() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 902, in __connect with util.safe_reraise(): File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__ raise exc_value.with_traceback(exc_tb) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 898, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 637, in connect return dialect.connect(*cargs, **cparams) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 615, in connect return self.loaded_dbapi.connect(*cargs, **cparams) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/connections.py", line 358, in __init__ self.connect() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/connections.py", line 664, in connect self._request_authentication() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/connections.py", line 976, in _request_authentication auth_packet = _auth.caching_sha2_password_auth(self, auth_packet) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/_auth.py", line 267, in caching_sha2_password_auth pkt = _roundtrip(conn, data) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/_auth.py", line 120, in _roundtrip pkt = conn._read_packet() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/connections.py", line 772, in _read_packet packet.raise_for_error() File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "/Users/someone/.pyenv/versions/fastapi-env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'root'@'localhost' (using password: YES)") (Background on this error at: https://sqlalche.me/e/20/e3q8) Check the PassWord Hashing Method: If the MySQL server is using caching_sha2_password but the client (like PyMySQL) doesn't support it, it can give rise to such issues. You can switch the MySQL user's password hashing method to mysql_native_password . 이런 글도 있어서 따라하고 새로 비밀번호를 todos 로 넣어줬는데도 마찬가지네요. 더 참고할만한 내용이 있을까요?
강사님, 안녕하세요 EBS 다중 연결을 강의에선 하나의 EC2 인스턴스에 여러 개의 볼륨과 연결하는 기능으로 설명하셨는데 자료 상에선 하나의 EBS 볼륨을 여러 EC2에 동시에 연결하는 기능이라고 돼 있습니다. 이 두 가지를 모두 EBS 다중 연결이라고 표현하는지 궁금합니다. 감사합니다.
강사님, 안녕하세요. GWLB(게이트 웨이 로드 밸런서)에 대해 질문드립니다. 온프레미스 네트워크 장비인 방화벽, IPS, IDS의 OS 이미지를 AWS의 EC2인스턴스와 연결해 보안 어플라이언스에 대한 암호화된 트래픽을 분산 처리하기 위해 로드밸런싱을 하는데. 이 트래픽을 단일 게이트웨이 지점인 게이트 웨이 로드밸런서의 엔드 포인트로 보내고 그 다음은 게이트 웨이의 로드밸런서로 보낸 후 다시 GWLBe로 보내고 각각의 엔드포인트로 분산해서 트래픽을 전송하는 게 맞는지 문의드립니다. GWLB는 4계층인데 GWLBe는 3계층인데. 동작 방식은 어떤지 왜 계층이 다른지 궁금합니다. 감사합니다.
1. 무엇을 하고 싶으신가요? 디렉토리가 없다고 나옵니다 2. 언제, 어떤 오류가 발생하시나요? incle@incleuicBookPro ~ % mkdir -p /Users/incle/.terraform.d/plugin-cache 위명령어를 통해 디렉토리를 생성했습니다. incle@incleuicBookPro terra % terraform init Terraform initialized in an empty directory! The directory has no Terraform configuration files. You may begin working with Terraform immediately by creating Terraform configuration files. incle@incleuicBookPro terra % terraform init Terraform initialized in an empty directory! 3. 어떤 시도를 해보셨나요? 강의 내용에 있는 걸 그대로 붙여넣었고 테라폼인잇 명령어를 친결과입니다. 4. 작성한 코드를 공유해주세요. provider "aws" { region = "ap-northeast-2" } data "aws_caller_identity" "current" {} output "account_id" { value = data.aws_caller_identity.current.account_id } output "caller_arn" { value = data.aws_caller_identity.current.arn } output "caller_user" { value = data.aws_caller_identity.current.user_id }
강사님 안녕하세요. 1) 파티션 배치 그룹에서 파티션 끼리는 서로 다른 하드웨어를 사용한다는 말은 동일한 파티션 내의 여러 대의 인스턴스를 배치했을 경우에 이 인스턴스는 서로 다른 하드웨어를 사용한다는 말인지 궁금합니다. 2) 하나의 파티션 내에 EC2 인스턴스들이 각각 다른 서버랙에 위치한 EC 인스턴스들을 파티셔닝 하는 이유가 궁금합니다. 3) 빅데이터 분산 처리 시스템에서 파티션 배치 그룹을 사용한다라고 설명 돼 있는데. 어떤 느낌인지 조금 더 자세한 설명 부탁드립니다.