Hello,
I'm a very beginner of Python. I teach myself Python with videos.
My question is I write an dead loop of while. How should I stop the programme running crazily?
The instructor in the videos say,"for such a case, I should just use "ctrl + c" or go to task manager and select the programme, so I can stop the programme of "while" of loop.
However it didn't work at all with the two ways.
-ctrl +c nothing happen
-task manager: I select the programme, but I fail to kill the programme. The programme is just keeping opening mp3 one after another.
Finally I have to shut down the computer to stop the programme.
The following is the codes I write for your reference only, I don't request you to correct my codes, and other people have to point out that I need to use sleep(), and i = i +1 , etc.
I'm a very beginner of Python. I teach myself Python with videos.
My question is I write an dead loop of while. How should I stop the programme running crazily?
The instructor in the videos say,"for such a case, I should just use "ctrl + c" or go to task manager and select the programme, so I can stop the programme of "while" of loop.
However it didn't work at all with the two ways.
-ctrl +c nothing happen
-task manager: I select the programme, but I fail to kill the programme. The programme is just keeping opening mp3 one after another.
Finally I have to shut down the computer to stop the programme.
The following is the codes I write for your reference only, I don't request you to correct my codes, and other people have to point out that I need to use sleep(), and i = i +1 , etc.
import os i = 1 while i < 8 : fname = 'd:/1/1' + str(i) + '.mp3' os.system(fname)My OS is Windows 7