Python Forum
Go to line starting with and variable not detected
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Go to line starting with and variable not detected
#2
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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Go to line starting with and variable not detected - by ichabod801 - Aug-08-2018, 03:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python not detected on computer adriennn 3 1,140 Nov-18-2023, 02:46 PM
Last Post: snippsat
  My .exe made using Python being detected as a virus 100grassfed 2 3,091 Jun-16-2021, 04:41 AM
Last Post: buran
  Finding line numbers starting with certain string Sutsro 3 2,599 Jun-27-2020, 12:36 PM
Last Post: Yoriz
  python --version yields no output, not detected by other programs ten 3 3,516 Jun-25-2020, 04:48 AM
Last Post: perfringo
  "Widget Javascript not detected" error BobLoblaw 0 4,345 Oct-07-2017, 04:48 PM
Last Post: BobLoblaw
  Object Detection that records the number of secs the face is not detected trabis03 1 2,572 Jul-21-2017, 04:14 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020