Python 3x move to next line

Python 3x move to next line

Discuss the workings and policies of this site

Why is the difference between these functions constant?

What bond exists in red oxygen, and can something similar happen with hydrogen?

Jon Skeet Answers Your Questions IRL

SCR (aka thyristor) symbol in TikZ circuit

Ive got a small script that is extracting some text from a .html file.

Can an incoming President take power slightly earlier or later to avoid conflict with a Sabbath?

Why is Windows using CRLF and Unix just LF when Unix is the older system?

f = open(local_file,r) found = -1 for line in f: if found == 2: print(Line: +line); break elif found 0: found += 1 else: searchphrase = span class=position if searchphrase in line: print(found it) found = 1

Why cant I cd to a quoted tilde (~)?

Join Stack Overflowto learn, share knowledge, and build your career.

Detailed answers to any questions you might have

Stack Overflow for Teams is Now Available

Learn more about Stack Overflow the company

Start here for a quick overview of the site

How can i make the neck of this deck light

site design / logo 2018 Stack Exchange Inc; user contributions licensed undercc by-sa 3.0withattribution required.rev2018.5.4.30300

Sign uporlog into customize your list.

Whats the meaning of bash script lines beginning with $?

A private, secure home for your teams questions and answers.

That works fine for me(error handling will be imported later), my problem is that the text I want to extract follows 2 lines after the searchphrase. How can I move 2 lines down in the .html file ?

Instead of callingbreakyou may also resetfoundto -1 to search for more occurences of the pattern…

By posting your answer, you agree to theprivacy policyandterms of service.

Maximum number of opcodes for a microprocessor

I underpriced a prior job, how should I tell my client that Im charging significantly more for new work?

Were there Gnomes in any of Tolkiens works?

Can you reserve a seat with a free child ticket for trains in the UK?

You can advancef(which is an iterable) by two lines by callingnext()on it twice:

Selling the right to kill ones convicted abuser: how could an NGO make this profitable?

One of my stock positions has grown substantially. Should I rebalance my portfolio?

Does a fighters Action Surge trigger Extra Attack?

How do I respond to someone apologizing for coughing/yawning?

Learn more about hiring developers or posting ads with us

with open(local_file,r) as f for line in f: searchphrase = span class=position if searchphrase in line: print(found it\n) next(f) skip 1 line return next(f) and return the line after that.

Implications of parity violation for molecular biology

However, if you are trying to parse HTML, consider using a HTML parserinstead. UseBeautifulSoup, for example.

Why does Doctor Strange not bind Thanos in a time loop?

What modifications would be needed to turn an oil rig into a self sustaining base?

Leave a Comment