I want my program to go to a certain line in the program which is running when it I needed to and run from there. Is this possible and if so How can this be done?
Asked
Active
Viewed 3,162 times
-1
-
3gotos are a terrible idea. Use modules, functions and objects – Alvaro Jan 22 '14 at 18:00
1 Answers
3
Put whatever lines you want to be done in a function, then put the function call where you want. Goto
is bad form in any language, and it doesn't exist in Python.
If you think your code is too short to warrant a full function, you can use a lambda
function (but those can be tricky).

Joshua Klein
- 189
- 2
- 13

wnnmaw
- 5,444
- 3
- 38
- 63
-
I want it to loop back to that line and run the next section from there – dashernasher Jan 22 '14 at 18:05
-
1@dashernasher So take that section and put it in a function. You can do whatever it is you want to do without a `goto` command, you just have to structure your script the right way – wnnmaw Jan 22 '14 at 18:07
-
There is no case whatsoever when someone would replace a goto with a lambda. Your second paragraph is... weird. – Wooble Jan 22 '14 at 18:48