비쥬얼 스튜디오에서는 되는데 명령 프롬포트에선 실행되지 않습니다
122
작성한 질문수 3
프롬포트
C:\>C:\infrun\qwer\python1.0_source\source_code\chapter10_011.py
what is your nameiys
hi iys time to play hangman man
start loading
Traceback (most recent call last):
File "C:\infrun\qwer\python1.0_source\source_code\chapter10_011.py", line 21, in <module>
with open('source_code/resource/word_list.csv','r') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'source_code/resource/word_list.csv'
비쥬얼 스튜디오
import time import csv import random import winsound name = input('what is your name') print('hi',name,'time to play hangman man') print() time.sleep(1) print('start loading') print() time.sleep(0.5) words=[] with open('source_code/resource/word_list.csv','r') as f: reader = csv.reader(f) next(reader) for c in reader: words.append(c) random.shuffle(words) q = random.choice(words) words=q[0].strip()
답변 1
0
안녕하세요. sukim님
해당 경로에서 csv 파일을 찾지 못해 나오는 현상입니다.
csv파일을 실행파일과 같은 경로에 두시거나 vscode 실행 위치를 실행파일이 있는 경로에서
실행해주시면 됩니다.
감사합니다.
자료 다운로드 위치 확인 부탁드립니다.
0
10
1
보라색 예약어
0
21
1
#을 붙이는 이유
0
19
1
실행이 안 되는데요.
0
19
1
print 문법 실행 안 돼요.
0
20
1
영문 계정
0
21
1
맥북에서 아이패드로 연결해서 보려고 하면 화면이 안뜹니다.
0
13
1
인스턴스 변수 문의
0
58
1
챕터 03_04 (튜플) 교육자료
0
58
2
Package(3-1) Sub 폴더 자료
0
48
1
아톰 출력 안됨
0
85
2
강의자료 메일 발송 요청 드립니다.
0
93
1
강의자료 메일로 보내주실 수 있으실까요?
1
59
0
Iterable 요소는 리스트로 작성해야하는 것 맞나요?
1
83
2
강의자료 부탁드립니다
0
77
2
if Flase: print('Bad')
0
76
1
=와 == 의 차이
0
96
1
functions 함수 섭들을려고하는데요
0
74
1
강의자료 부타드리겠습니다!
0
63
0
VSCODE에 VIEW에서 SELECTED INTERPRETER조회가 안됩니다.
0
71
1
강의자료 부탁드립니다.
0
59
0
dict의 Key를 바꾸는 방법
0
83
1
강의자료부탁드립니다
0
72
1
run withount 디버깅 및 F5+ctrl이 안먹혀요
0
69
1





