Jump to content

Anyone know how to write to a specific line? I need it to be able to modify the stock value. I got lines[line+1] which will set it to the right line. Please if anyone has any ideas message me.

 

Code: Barcode Checker - Task 3.py

Text File: barcodes.txt

 

I need it to change the stock value, so it's currently 10 for the titan X but when they say they want 5 it will do the sum 10 (stock variable)  - 5 then overwrite the new value into the file on that line it was on before.

Link to comment
https://linustechtips.com/topic/567200-python-writing-to-a-specific-line/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×