Question: python3 Trying to get the code so it: 1 - pulls timestamps from the file 2 - pulls those one at a time and each

python3
Trying to get the code so it:
1 - pulls timestamps from the file
2 - pulls those one at a time and each time another one
Problems:
This is what I get from my current code:
1 - it does not actually pull timestamps
2 - every time I run it it gives me the same output
3 - maybe I can alter Problem 2 by calling the program or using next() somehow?
 python3 Trying to get the code so it: 1 - pulls
This is the back-end as is.
timestamps from the file 2 - pulls those one at a time
Previous version of the same.
and each time another one Problems: This is what I get from
But this one yields all at once.
my current code: 1 - it does not actually pull timestamps 2
Complete solution please.
This is a Python generator/yield problem in case you missed it. Meaning the advantage is to pull from a large file faster.
Ty!

Ivkorolorenills -]} nano VRHW3v1.py [vkorolof@hills - ]$ python3 VKHW3v1.py first [vkorolofhills -]$ python3 VKHW3v1.py first?.. [vkorolof@hills -]$ python3 VKHW3v1.py first [vkorolof@hills ~]$ python3 VKHW3v1.py first Sivkorolof@hills -]$ python3 VKHW307.py first ''[vkorolof@hills -]$ Lenovo 'import datetime f = open('/etc/httpd/logs/access_log', 'T') def gen() : n=1 print('first') yield next n+=1 print('second') yield next n+=1 print('third') yield next . a = gen() next(a) import datetime f = open('/etc/httpd/logs/access_log', 'I def gen() : n=1 print('first's yield next n+=1 print('second') yield next n+=1 print('third') yield next a = gen() .. next(a) next(a) next(a) NG Get Help AX Exit O Writeout Justify [vkorolof@hills -]$ python3 VKHW3v1.py. first second third '[vkorolof@hills

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!