비쥬얼 스튜디오에서는 되는데 명령 프롬포트에선 실행되지 않습니다
134
작성한 질문수 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
38
1
화면이 안보입니다
0
69
1
3-1 sub 폴더를 찾을 수 없습니다
0
72
1
강의자료 누락
0
71
1
Python: Select Interpreter 오류
0
103
1
54강 4분 41초에서 질문 있어요.
0
82
1
import
0
50
1
45강 예제4번에서 질문 있어요!
0
73
1
45강 강의 10분 03초 내용에서 x + 1 을 하는 이유는 뭔가요?
0
67
1
3강, 7강 화면이 안나옵니다. 그냥 검은화면으로만 노출되요;;
0
82
1
41강 1분 39초 영상에서 import test_module이 조회 안 돼요.
0
79
1
29강 while(3-1) 5분 20초 강의 영상 질문
0
66
0
pcskjs@naver.com
0
83
1
인터프리터 설정이 안됩니다.
1
123
1
Python formatter 설치
0
64
1
자료 다운로드 위치 확인 부탁드립니다.
0
64
2
보라색 예약어
0
68
1
#을 붙이는 이유
0
74
1
실행이 안 되는데요.
0
107
1
print 문법 실행 안 돼요.
0
79
1
영문 계정
0
63
1
맥북에서 아이패드로 연결해서 보려고 하면 화면이 안뜹니다.
0
61
1
인스턴스 변수 문의
0
96
1
챕터 03_04 (튜플) 교육자료
0
106
2





