묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결웹 게임을 만들며 배우는 React
함수형 컴포넌트 Hooks 매번 재실행되면?
현영님 안녕하세요. 함수형 컴포넌트가 매번 재실행된다 / 그래서 props, state 등을 쓰지 않을 함수는 밖으로 빼라 라고 하셨는데 그럼 변수선언 useState 할당도 (예를 들면 const [apple, setApple] = useState("사과");) 매번 다시 일어나게 되는건가요? 그건 아닌것 같은데.. 어떻게 이해하면 좋을지 궁금합니다.
-
미해결
Are You Looking For The Best Used Car Buyers In Auckland?
CarRemovals is the place to go if you're looking to sell or buy used cars Auckland, New Zealand. They pay top dollar for cars of all makes and models, and they handle all of the paperwork and removal. So, no matter what kind of vehicle you have, they can assist you in getting rid of it fast and easily. The Best Used Car Buyers Auckland - this is the quickest, simplest, and most profitable solution. Call them today at 0800 392 392 or fill out an online form to find out how much your car is worth.
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
redux dev tools 질문드립니다.
안녕하세요. redux dev tools 질문드립니다. airbnb 사이트를 보면 redux dev tools를 이용해서 redux state들을 확인할 수 있는데 개발 모드가 아닌 배포 모드에서는 저렇게 state들을 볼 수 있게 하는 것이 좋지 않은건가요? 몇몇 사이트들을 보면 redux state들을 볼 수 있는데 보안에 문제가 되지 않는 state들이면 볼 수 있게 해도 상관없는건지 아니면 그냥 state들 자체를 모두 다 숨기는 게 좋은건지 궁금합니다.
-
미해결
How To Get The Highest Cash For Cars In Auckland?
Are you looking for advice on how to get the highest cash for cars in Auckland? You've come to the right place! CarsWreckers will provide you with all the information you need to make an informed decision about your car purchase. Selling your car is a great way to get some extra cash for a down payment on a used car. If you're looking to get an instant junk car removal service, you can do a few things to make the process go as smoothly as possible. Call Now!!
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
컴포넌트를 ()로 감싸지 않으면 화면에 출력되지 않는 이유가 뭔가요?
안녕하세요 제로초님 강의 정말 잘 듣고있습니다. 코딩을 하다 궁금한점이 있는데 FollowList.js파일의 renderItem속성부분을 아래 코드와 같이 ()로 감싸지 않으면화면에 출력되지 않더라고요 renderItem={(item) => { <List.Item style={{ marginTop: 20 }}> <Card actions={[<StopOutlined key="stop" />]}> <Card.Meta description={item.nickname} /> </Card> </List.Item> } 그래서 다시 아래 코드처럼 ()로 감싸니까 정상적으로 화면에 출력이 되던데 그 이유에 대해서 알 수 있을까요? renderItem={(item) => ( <List.Item style={{ marginTop: 20 }}> <Card actions={[<StopOutlined key="stop" />]}> <Card.Meta description={item.nickname} /> </Card> </List.Item> )}
-
미해결배달앱 클론코딩 [with React Native]
[iOS] 앱 아이콘, 스플래시 스크린 적용 문제
안녕하세요 제로초님 항상 감사드립니다. 강의 8:14 에서보면 XCode 오른쪽 탭에서 Target Membership이 FoodDeliveryApp에 체크 되어있는 것으로 보이는데 반면 제 XCode 에서는 disabled로 되어있습니다. 이 때문에 앱 아이콘과 스플래시 스크린이 정상적으로 작동 하지 않는 걸로 추측하고 있는데, 검색해보아도 해결이 안되어서 도움을 요청합니다~! 사진도 같이 첨부합니다 !
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
손님이 20명 동시에 입장요청을 할때
listenSocket.Listen(10) 으로 최대 대기수를 10으로 제한해두어서, 만약 20개가 동시에 입장 요청을 하면 앞 10명만 listenSocket의 대기에 넣어두다가,(뒤에 10명은 fail) Socket clientSocket = listenSocket.Accept(); 로 한명씩 입장시키고, recv send 하고 그 후 clientSocket.Close(); 한 후에 다음 대기번이 다시 Socket ClientSocket = listenSocket.Accept(); 되서 순서대로 하나씩 처리하는건가요?
-
미해결함수형 프로그래밍과 JavaScript ES6+ 응용편
이해한게 맞을까요?
each는 인자와 함수를 전달받는데 함수를 실행시켜 효과를 일으키되 원래 인자를 그대로 리턴해준다? 라고 이해하면 되나요?
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
테스트 에러때문에 질문드립니다.
근 3시간동안 다른 분들 비슷한 에러 메시지의 질문을 확인해봤는데 도저히 해결이 안되어 남깁니다.. 에러 메시지는 다음과 같습니다. java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'memberRepository': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.persistence.EntityManagerFactory' available at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:351) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1415) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:608) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:923) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:122) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ... 27 more Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.persistence.EntityManagerFactory' available at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1210) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:565) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:528) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:696) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:669) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:228) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:348) ... 44 more 그리고 *************************** APPLICATION FAILED TO START *************************** Description: A component required a bean of type 'javax.persistence.EntityManagerFactory' that could not be found. Action: Consider defining a bean of type 'javax.persistence.EntityManagerFactory' in your configuration. 이게 상부에 떠있구요 Member.java package jpabook.jpashop;import lombok.Getter;import lombok.Setter;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;@Entity@Getter @Setterpublic class Member { @Id @GeneratedValue private Long id; private String username;} MemberRepository.java package jpabook.jpashop;import org.springframework.stereotype.Repository;import javax.persistence.EntityManager;import javax.persistence.PersistenceContext;@Repositorypublic class MemberRepository { @PersistenceContext private EntityManager em; public Long save(Member member) { em.persist(member); return member.getId(); } public Member find(Long id) { return em.find(Member.class, id); }} MemberRepositoryTest.java package jpabook.jpashop;import org.assertj.core.api.Assertions;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.context.SpringBootTest;import org.springframework.test.context.junit4.SpringRunner;import org.springframework.transaction.annotation.Transactional;import static org.junit.jupiter.api.Assertions.*;@RunWith(SpringRunner.class)@SpringBootTestpublic class MemberRepositoryTest { @Autowired MemberRepository memberRepository; @Test @Transactional public void testMember() throws Exception { //given Member member = new Member(); member.setUsername("memberA"); //when Long savedId = memberRepository.save(member); Member findMember = memberRepository.find(savedId); //then Assertions.assertThat(findMember.getId()).isEqualTo(member.getId()); Assertions.assertThat(findMember.getUsername()).isEqualTo(member.getUsername()); } application.yml spring: #띄어쓰기 없음 datasource: #띄어쓰기 2칸 url: jdbc:h2:tcp://localhost/~/jpashop #4칸 username: sa password: driver-class-name: org.h2.Driver jpa: #띄어쓰기 2칸 hibernate: #띄어쓰기 4칸 ddl-auto: create #띄어쓰기 6칸 properties: #띄어쓰기 4칸 hibernate: #띄어쓰기 6칸 # show_sql: true #띄어쓰기 8칸 format_sql: true #띄어쓰기 8칸logging.level: #띄어쓰기 없음 org.hibernate.SQL: debug #띄어쓰기 2칸 띄어쓰기는 다 수정해봤고, 오타도 봤는데 잘 모르겠습니다.. H2는 켜져있고, build.gradle은 plugins { id 'org.springframework.boot' version '2.4.1' id 'io.spring.dependency-management' version '1.0.10.RELEASE' id 'java'}group = 'jpabook'version = '0.0.1-SNAPSHOT'sourceCompatibility = '11'configurations { compileOnly { extendsFrom annotationProcessor }}repositories { mavenCentral()}dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-devtools' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test'//JUnit4 추가 testImplementation("org.junit.vintage:junit-vintage-engine") { exclude group: "org.hamcrest", module: "hamcrest-core" }}test { useJUnitPlatform()} 위와 같습니다.도움 주시면 감사하겠습니다.
-
미해결스프링 시큐리티
jwt 토큰방식에서의 세션 미사용 질문
강의에서 jwt방식을 예로 드셨던 세션정책Stateless에서 세션을 사용하지 않는다고 말씀하셨습니다. 궁금한 점은 jwt토큰방식을 사용하더라도 세션은 사용하는 것이 아닐까라는 의문입니다. 이유는 jwt방식으로 인증에 성공하면 Authentication객체를 securityContext에 저장하고 세션에 캐싱을 하며 controller에서 principle이나 @preauthorize 등과같은 기능을 사용할 수 있기 때문입니다.
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
6:37초 질문입니다.
필터(x) 부분을 설명해 주시는데,, 궁금증이 생겼습니다. 내부에서 다시 요청을 보내는데, dispatchType=ERROR 라고 보낸다고 하셨고, 필터는 dispatchType=REQUEST 로 해 놓으면 호출이 안된다고 하셨습니다. 어디쪽 로직에서 이렇게 검증하는지 알 수 있을까요? 아니면, dispatchType=ERROR 왔기 때문에 필터 검증을 하지 않는 거라고 이해해도 되는건가요?
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
인텔리제이 타임리프 글자 색 설정 방법
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용] 인텔리제이 얼티메이트 버전 사용중입니다. 선생님 강의대로 진행중인데 타임리프 문법 작성시 글자 색이 바뀌지 않습니다. 전부 초록색으로 나오다보니 괄호 구분이 너무 힘드네요 혹시 설정할 수 있는 방법이 있을까요?
-
미해결
서울시 뉴딜일자리 사업 블록체인 it인턴 3개월 [월260만원] 참여하실분?
블록체인 분야 기술을 배우고싶은 분들 or 블록체인 분야 취업을 원하시는 분들 주목! 서울시에서 뉴딜일자리사업 일환으로 IT 블록체인과정으로 3개월 인턴십 (급여 월 260) 보내주는 프로그램 진행중인데 신청해보세요! https://blog.naver.com/kjc_sh/222745988610 자세한 내용은참고해주세요 오픈카카오톡 문의 [ https://open.kakao.com/o/stkiOIhe ]
-
미해결따라하며 배우는 리액트 테스트 [2023.11 업데이트]
MSW 질문입니다
MSW를 사용해 구현하는것이 json-server를 사용하는 것과 비교했을때 갖는 이점이 어떤게 있나요? end to end 테스트를 하지 않고 중간에서 서비스워커가 백그라운드에서 실행하는 형태 라는 이점이 있는건가요? '그렇다면 리소스 낭비를 하지 않는다' 라는 이점이 있는걸까요?
-
해결됨풀스택 리액트 토이프로젝트 - REST, GraphQL (for FE개발자)
typeScript에 대한 질문을 어디다가 올려야할지 몰라서 여기다가 남깁니다!
const fetcher = async ( method: METHOD, url: string, ...rest: { [key: string]: any }[] ) => { const res = await axios[method](url, ...rest) return res.data } export default fetcher 위에 ...rest 에 대한 타입이 궁금해서 질문드립니다! 글을 새로 생성하거나 수정했을때 아래와 같이 객체로 정보가 담기게 되는데요! 1. key값은 id, text, timestamp, userId 라고 생각하면 되는건가요? 2. any는 response에 대한 타입인건가요? 3. Array 안에 Object로 감싸져 있어서 { [key: string]: any} []로 타입을 지정해준건가요? 위에 3가지 질문이 궁금합니다.. ㅜ { id: "36e1a2bc-177b-4743-9152-d7423c7b9e18" text: "asd" timestamp: 1654591409339 userId: "jin" }
-
미해결스프링 시큐리티
Http Basic인증
Http Basic인증에 관한 자료가 ppt에 제공돼있습니다. 11번째 슬라이드부터 설명이 있습니다. 강의에서는 누락이 된것인지 궁금합니다.
-
미해결자바스크립트 알고리즘 문제풀이 입문(코딩테스트 대비)
안녕하세요 혹시 이렇게 풀어도 될까요?
function solution_3_my(n, array) { let answer = []; const students = Array.from({ length: n }, (_, index) => index + 1); students.forEach((firstS) => { students.forEach((secondS) => { if (firstS === secondS) return; let pi = 0; let pj = 0; let flage = true; for (let s = 0; s < array.length; s++) { const roundS = array[s]; // 처음 뽑은 학생의 등수 pi = roundS.findIndex((v) => v === firstS); // 두번째 뽑은 학생의 등수 pj = roundS.findIndex((v) => v === secondS); if (pi > pj) { flage = false; break; } } if (flage) answer.push([firstS, secondS]); }); }); return answer; }
-
미해결
Air Jordan 1 Zoom that dropped to the floor
Many brands scheduled to participate at Pitti Uomo this week, including special guest designer Ann Demeulemeester, postponed their IRL appearances. However, the fair's loyal menswear enthusiasts are present and correct. This week, Vegas embraced his fashion signatures. His closet fuses elements of vintage and streetwear-it's heavy on pieces from Awake NY and his own brand, Primer-and the street style star says he experimented with combining textures and prints. Ever wonder how a top model gets ready for fashion week? Lineisy Montero has it down to an exact science. During New York Fashion Week, the Dominican beauty, who walked for Tory Burch, took Vogue along for her pre catwalk routine. Designers rebelled against last year's minis with hemlines Air Jordan 1 Zoom that dropped to the floor, creating statuesque shapes. Suits were defined by genderless, oversized blazers that hung from widened shoulders. Create the signature Burberry brow with Effortless Eyebrow Definer. The dual-ended eyebrow pencil and brush effortlessly define and shape, creating naturally fuller-looking brows. It was important because during fashion month you saw lots of fashion brands completely ignoring what is going on in Ukraine. The primer is housed in luxurious gold packaging adorned with the houses iconic check pattern. A youthful, sparkling twist on the iconic Burberry Body fragrance. The scent opens with a fresh surge of lemon, crisp apple and green absinthe. I felt myself entering a new orbit outside the Collina Strada spring 2022 show in Brooklyn: A guest whooshed past me in an Air Jordan Shoes orange mesh top, cascades of lilac ruffles, and platform teal sneakers, frills fanning out in the breeze. On the Brooklyn Grange rooftop farm, where designer Hillary Taymour had constructed a runway between the kale and basil harvests, another was wearing a vintage blouse with translucent white pants and a coral necklace the size of the Great Barrier Reef. Funny enough, the first channel that came on was FTV Fashion TV. Inspired by the trench coat and its heritage of British design and craftsmanship, My Burberry captures the fragrance of a Air Jordan 1 Womens London garden after the rain. Introducing Burberry Hero, Riccardo Tiscis first scent for Burberry. Enigmatic and adventurous, Burberry Hero is an enthralling marriage of strength and subtlety, power and compassion, athleticism and creativity. With a new satin finish and long-lasting formula, Burberry Kisses lip colour has an intense pigment that creates medium to high coverage and stays in place all day long. The hyaluronic acid-enriched formula helps keep lips hydrated and comfortable for up to 24 hours.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
MemberService 구현 시 .ifPresent() 에러 문의드립니다
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술 수강중입니다. (회원 관리 예제 - 백엔드 개발 - 회원 서비스 개발) 강의를 따라가던 중 회워가입시 중복된 이름 회워가입 판별하는 메서드 관련하여 .present() 를 하면 에러가 납니다. 제가 강의에서 놓친 부분이 있는것인지 비교를 해보는데 다른것이 없어 여쭈어봅니다. 아래는 코드 입니다. public Long join(Member member) { //같은 이름이 있는 중복 회워은 안됨 memberRepository.findByName(member.getName());service .ifPresent(m -> //.ifPresent() 'rename referece' 라고 에러가 뜹니다. Cannot resolve method 'ifPresent in 'MemberService' {throw new IllegalStateException("이미 존재하는 회원입니다"); }); memberRepository.save(member); return member.getId();}
-
미해결파이썬 무료 강의 (활용편4) - 업무자동화 (RPA)
함수 계산 결과 불러오기
함수를 입력했을 때 계산값이 저장이 안되서 조건문이 제대로 역할을 하지 못하는데요. 따로 열어서 계산 후 저장하고 프로그램 돌리는 것 없이 바로 함수 계산값을 활용할 수 있는 방법은 없나요? from openpyxl import Workbook from random import * wb = Workbook() ws = wb.active ws.title = "Project" #주어진 점수표 랜덤 생성 max_value = [10, 10, 10, 20, 30, 20] ws["A1"] = "학번" ws["B1"] = "출석" ws["C1"] = "퀴즈1" ws["D1"] = "퀴즈2" ws["E1"] = "중간고사" ws["F1"] = "기말고사" ws["G1"] = "프로젝트" for y in range(1, 8): if y==1: for x in range(2, 11): ws.cell(row = x, column = y, value = x-1) else: for x in range(2, 11): ws.cell(row = x, column = y, value = randint(0, max_value[y-2])) #조건에 맞게 수정 y=4 for x in range(2, 11): ws.cell(row = x, column = y, value = 10) ws["H1"] = "총점" y=8 for x in range(2, 11): ws.cell(row = x, column = y, value = f"=sum(B{x}:G{x})") ws["I1"] = "성적" y=9 for x in range(2, 11): if ws[f"B{x}"].value < 5: ws[f"I{x}"] = "F" else: if ws[f"G{x}"].value >= 90: ws[f"I{x}"] = "A" elif ws[f"G{x}"].value >= 80:# and ws[f"G{x}"].value < 90: ws[f"I{x}"] = "B" elif ws[f"G{x}"].value >= 70:# and ws[f"G{x}"].value < 80: ws[f"I{x}"] = "C" else: ws[f"I{x}"] = "D" wb.save("scores.xlsx")