비쥬얼 스튜디오에서는 되는데 명령 프롬포트에선 실행되지 않습니다
127
작성한 질문수 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 실행 위치를 실행파일이 있는 경로에서
실행해주시면 됩니다.
감사합니다.
Python: Select Interpreter 오류
0
40
1
54강 4분 41초에서 질문 있어요.
0
57
1
import
0
37
1
45강 예제4번에서 질문 있어요!
0
55
1
45강 강의 10분 03초 내용에서 x + 1 을 하는 이유는 뭔가요?
0
49
1
3강, 7강 화면이 안나옵니다. 그냥 검은화면으로만 노출되요;;
0
53
1
41강 1분 39초 영상에서 import test_module이 조회 안 돼요.
0
56
1
29강 while(3-1) 5분 20초 강의 영상 질문
0
51
0
pcskjs@naver.com
0
60
1
인터프리터 설정이 안됩니다.
1
76
1
Python formatter 설치
0
46
1
자료 다운로드 위치 확인 부탁드립니다.
0
50
2
보라색 예약어
0
50
1
#을 붙이는 이유
0
46
1
실행이 안 되는데요.
0
60
1
print 문법 실행 안 돼요.
0
55
1
영문 계정
0
48
1
맥북에서 아이패드로 연결해서 보려고 하면 화면이 안뜹니다.
0
43
1
인스턴스 변수 문의
0
83
1
챕터 03_04 (튜플) 교육자료
0
88
2
Package(3-1) Sub 폴더 자료
0
70
1
아톰 출력 안됨
0
118
2
강의자료 메일 발송 요청 드립니다.
0
123
1
강의자료 메일로 보내주실 수 있으실까요?
1
79
0





