Closed ghost closed 6 years ago
cosme12 said that this type of changes has to been pulled to branch v1.1.0, not master You can quickly change this in "edit pull request"
Dont worry. I changed it for you. But someone already did a change similar to yours. Check branch v1.1.0
sorry, I did not know he had to go on v1.1.0. I see only wallet.py in master. Sorry
@KKK00 dont worry. Check if this is better: branch v1.1.0
yes is the same think :)
@KKK00 I would suggest using the with
statement for opening files. So this;
new_file=open("wallet", "a")
new_file.write(f"Private key: {private_key}" + f"\nWallet address / Public key: {public_key.decode()}")
print(f"Your new address and private key are now in the file {new_file}")
new_file.close()
Becomes this (with some additional changes I’ve made);
filename = “wallet”
with open(filename, “a”) as f:
f.write(“Private key: {}\nWallet address / Public key: {}”.format(private_key, public_key.decode())
print(“Your new address and private key have now been saved to {}”.format(filename))
I’ve removed f-strings to retain compatibility with Python versions up to 3.5. F-strings are a Python 3.6 feature. In addition, there is really no need to concatenate those two strings together. Simply make it a single string and format it all at once 👍
Is there no related file extension this file should be using? I feel like we should at least not store private keys in a plaintext file.
I’ve created PR https://github.com/cosme12/SimpleCoin/pull/28 which should address some of these issues, plus a few other things.
I'm very very new of python but i like this project. I have added the code to create wallet file.