Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

##lesson5: doesnt display the account created in code #197

Answered by PatrickAlphaC
amitnil-dev asked this question in Q&A
Discussion options

(venv) PS D:\Solidity\brownie_simple_storage> brownie run scripts/deploy.py
INFO: Could not find files for the given pattern(s).
Brownie v1.16.4 - Python development framework for Ethereum

BrownieSimpleStorageProject is the active project.
Attached to local RPC client listening at '127.0.0.1:8545'...

Running 'scripts\deploy.py::main'...
Hello!

deploy.py

from brownie import accounts
def deploy_simple_storage():
 account = accounts.load("freecodecamp-account")
 print("account")
def main():
 print("Hello!")

it just prints hello and exits.

You must be logged in to vote

Brownie starts with your main function, and your main function currently only does print("Hello!")!

To fix this, you'd have to move your other function into the main function, and change your "account" string to "account" the variable:

from brownie import accounts
def deploy_simple_storage():
 account = accounts.load("freecodecamp-account")
 print(account)
def main():
 print("Hello!")
 deploy_simple_storage()

Replies: 2 comments 2 replies

Comment options

Did you set up the account in brownie?

brownie accounts new account-name

make sure to provide a secret key and a password.

Additionally don't forget to import accounts

from brownie import accounts

You must be logged in to vote
1 reply
Comment options

Yeppers, i did as per the tutorial, something very strange not sure why it skips.

Comment options

Brownie starts with your main function, and your main function currently only does print("Hello!")!

To fix this, you'd have to move your other function into the main function, and change your "account" string to "account" the variable:

from brownie import accounts
def deploy_simple_storage():
 account = accounts.load("freecodecamp-account")
 print(account)
def main():
 print("Hello!")
 deploy_simple_storage()
You must be logged in to vote
1 reply
Comment options

thanks, i figured it soon as i posted here. exactly as you mentioned i missed calling the function after the main. thanks patrick. great video.

Answer selected by PatrickAlphaC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /