I have run a script and wants to run it again with a "keypress" input from the user, how do i code that. Like this:
drive=input(" If you want to start the script again , press 1: ")
if drive == 1:
the above can be used to start a external program from inside a python script but if i only wants to run the same script again? I use "idle" when i code python, so i guess the script must open up again inside idle?
Hmm it didnt work, plainy how do you make a script run more then once without manual help? How do you create a funkction that ask if you want to run the script once or forever. in the start, i have tested some functions but none seems to work.
y will always be equal to y. I think you meant if y == 'y' . Like wise for the not equals (note you can also use != ). You really don't need to have another clause there, because if y is not equal to the character 'y' you already know it's not equal so you don't need to specifically check again. You can simply use if y == 'y' and else .
Finally, you made a class. That's not the way you're supposed to use a class, you should have defined a function.