Aug-08-2018, 03:02 PM
(This post was last modified: Aug-08-2018, 03:05 PM by ichabod801.)
I don't understand. You're saying the result of the first condition is not persisted. But isn't the result new_name? That appears to be persisted. Or are there cases where you don't find a new name, so you want to skip the bit with '/22/'?
Why do you have to go back and forth through the file? That's not easy in Python, so you'd be better off putting more persistence into your code to remember information it might need later, if you can.
Edit: If you really need to go back and forth, and the file is not too large, pull all the lines at once into a list. Searching back and forth through the list is much easier.
Why do you have to go back and forth through the file? That's not easy in Python, so you'd be better off putting more persistence into your code to remember information it might need later, if you can.
Edit: If you really need to go back and forth, and the file is not too large, pull all the lines at once into a list. Searching back and forth through the list is much easier.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures