Cannot correctly encode string when reading from text file (encoding into sha256…)

Cannot correctly encode string when reading from text file (encoding into sha256…)

Basically what I want to accomplish (simplified...):

Basically what I want to accomplish (simplified...):

I want to make 100 bitcoin addresses from my own password that look kind of like:

password_1 password_2 password_3

So when I do this in the program, I am getting the correct result:

def public_key(src):
    privatekey = (int(hashlib.sha256(src).hexdigest(), 16))
    return generate_address(privatekey)
def private_key(src):
    privatekey = hashlib.sha256(src).hexdigest()
    return str(privatekey)
herewego = "password_1".encode('utf-8')
somevariable = public_key(herewego)
print somevariable 

^ This works as intended...but if I put "password_1" in a txt file and try to read this line, it gives totally different result?

for addr in file:
 address =  addr.encode('utf-8')
 print public_key(address)

So the issue is obviously that Notepad encodes the text file in say ansi or utf-8, it doesn't matter but the line read from there must be looking different to python than when I enter the " ...." within python? So what coding to use or if it's impossible: what alternative to Notepad? This is for Python 2.7 in windows by the way.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Building a Blockchain with Python - Full

Why is Python good for Blockchain? Learnning Python by Building a Blockchain & Cryptocurrency

How to get bitcoin transaction info using Python

I am trying to get the following info from a bitcoin transaction: The wallet who sent the money, the wallet who received the money, and the amount of bitcoin sent. How can I do this with Python 3.6, using the Blockchain module (or other modules)? Thank you!

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...