비쥬얼 스튜디오에서는 되는데 명령 프롬포트에선 실행되지 않습니다
121
3 asked
프롬포트
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()
Answer 1
0
안녕하세요. sukim님
해당 경로에서 csv 파일을 찾지 못해 나오는 현상입니다.
csv파일을 실행파일과 같은 경로에 두시거나 vscode 실행 위치를 실행파일이 있는 경로에서
실행해주시면 됩니다.
감사합니다.
인스턴스 변수 문의
0
52
1
챕터 03_04 (튜플) 교육자료
0
51
2
Package(3-1) Sub 폴더 자료
0
46
1
아톰 출력 안됨
0
83
2
강의자료 메일 발송 요청 드립니다.
0
85
1
강의자료 메일로 보내주실 수 있으실까요?
1
57
0
Iterable 요소는 리스트로 작성해야하는 것 맞나요?
1
83
2
강의자료 부탁드립니다
0
75
2
if Flase: print('Bad')
0
74
1
=와 == 의 차이
0
92
1
functions 함수 섭들을려고하는데요
0
74
1
강의자료 부타드리겠습니다!
0
61
0
VSCODE에 VIEW에서 SELECTED INTERPRETER조회가 안됩니다.
0
70
1
강의자료 부탁드립니다.
0
58
0
dict의 Key를 바꾸는 방법
0
81
1
강의자료부탁드립니다
0
70
1
run withount 디버깅 및 F5+ctrl이 안먹혀요
0
68
1
강의 자료와 예정 다운로드
0
79
2
객체지향 vs 함수형
0
66
1
어렵네요 설정도
0
94
1
설정이 잘 된건지
0
54
1
맥 os vscode 설정 - python interpreter select
0
111
1
강의자료 부탁드립니다. mytoughgirl@naver.com 입니다.
0
49
1
vscode로 수업 진행한 영상은 없는건가요?
0
60
2

