Giúp sửa lỗi can't open file: [Errno 2] No such file or directory

can’t open file ‘ex1’: [Errno 2] No such file or directory

Bạn cd đến thư mục chứa file chưa?

1 Like

rồi mà no vẫn có lỗi đấy :((

bạn dùng powershell à? cd đến thư mục rồi thì gõ lệnh python ex1.py là ok mà :slight_smile:

1 Like
PS C:\Users\Windows\Saved Games\thumucmoi> python ex1.py
  File "ex1.py", line 7
    print 'I "said' do not touch this.'
                     ^
SyntaxError: invalid syntax

ủa lệnh hình như mình viết đúng mà sao nó cứ ra lỗi này nhỉ :confused:

Mình nghĩ nên viết thế này:

print 'I said: "You dont ..."'

3 Likes

viết vậy vẫn ra lỗi đấy.

PS C:\Users\Windows\Saved Games\thumucmoi> python ex1.py
  File "ex1.py", line 7
    print 'i said:"you don't touch this"'
                                  ^
SyntaxError: invalid syntax

Bạn thử cái này nhé:

print 'i said:"you don\'t touch this"'

3 Likes

mình chạy dc r tks nhiều nha :smiley:

Bạn bấm chọn câu trả lời đúng để đánh dấu topic đã solved nhé :smile:

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?